ElasticSuggestionsQuery class

An object containing all the settings to execute a suggestion query

See https://www.elastic.co/guide/en/app-search/current/query-suggestions-guide.html to get more information about all the parameters.

Annotations
  • @freezed

Constructors

ElasticSuggestionsQuery({@JsonKey(includeToJson: false, includeFromJson: false) ElasticEngine? engine, required String query, @JsonKey(name: "size") @Default(10) int? sizeField, @_ElasticSearchFieldsConverter() @JsonKey(name: "search_fields") List<_ElasticSearchField>? searchFields, @_ElasticSortConverter() @JsonKey(name: "sort") List<_ElasticSort>? sortBy})
const
factory
ElasticSuggestionsQuery.fromJson(Map<String, dynamic> json)
factory

Properties

copyWith → $ElasticSuggestionsQueryCopyWith<ElasticSuggestionsQuery>
no setterinherited
engine ElasticEngine?
An object representing an Elastic engine
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
query String
String or number to match.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
searchFields List<_ElasticSearchField>?
Object which restricts a query to search only specific fields.
no setterinherited
sizeField int?
Number of query suggestions. Must be greater than or equal to 1 and less than or equal to 1000. Defaults to 10.
no setterinherited
sortBy List<_ElasticSort>?
Object to sort your results in an order other than document score.
no setterinherited

Methods

get([CancelToken? cancelToken]) Future<ElasticQuerySuggestionResponse>
Fetch the documents for this query.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
searchField(String field, {int? weight}) ElasticSuggestionsQuery
Takes a field with an optional weight, creates and returns a new ElasticSuggestionsQuery
size(int size) ElasticSuggestionsQuery
Creates and returns a new ElasticSuggestionsQuery with new size parameters.
sort(String field, {bool descending = false}) ElasticSuggestionsQuery
Takes a field with an optionnal descending, creates and returns a new ElasticSuggestionsQuery which will sort your results in an order other than document score.
toJson() Map<String, dynamic>
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited