similarQuery method
SimilarQuery)
Overrides the query parameter and performs a more generic search that can be used to find “similar” results.
Usage notes:
- similarQuery should be constructed from the tags and keywords of the object you are trying to find related results to.
- similarQuery is not automatically generated. You need to select which keywords you think would be useful. For example, a similarQuery for a movie could use the genre, principle actors, and tags attributes. After extracting information from those categories, you might end up with a similarQuery that looks like: “Romance Comedy Gordon-Levitt NY”. Check out the examples section for a more detailed walk-through.
Source: Learn more
Implementation
AlgoliaQuery similarQuery(String value) {
assert(value.isNotEmpty, 'value can not be empty');
assert(!_parameters.containsKey('similarQuery'));
return _copyWithParameters(<String, dynamic>{'similarQuery': value});
}