ElasticQuery class
An object contaning all the settings to execute a query
See https://www.elastic.co/guide/en/app-search/current/search.html to get more information abouit all the parameters.
Note: All the paramaters of Elastic App Search are not currently available in this package.
- Annotations
-
- @freezed
Constructors
-
ElasticQuery({@JsonKey(includeToJson: false) ElasticEngine? engine, required String query, @protected @JsonKey(name: "precision") int? precisionTuning, @JsonKey(name: "page") _ElasticSearchPage? searchPage, @_ElasticSearchFiltersConverter() List<
_ElasticSearchFilter> ? filters, @_ElasticSearchFieldsConverter() @JsonKey(name: "search_fields") List<_ElasticSearchField> ? searchFields, @_ElasticResultFieldsConverter() @JsonKey(name: "result_fields") List<_ElasticResultField> ? resultFields, @protected Map<String, _ElasticQueryFacet> ? facets, @JsonKey(includeToJson: false) List<String> ? disjunctiveFacets, _ElasticAnalytics? analytics, @protected @JsonKey(name: "group") _ElasticGroup? groupBy, @_ElasticSortConverter() @JsonKey(name: "sort") List<_ElasticSort> ? sortBy}) -
constfactory
-
ElasticQuery.fromJson(Map<
String, dynamic> json) -
factory
Properties
- analytics → _ElasticAnalytics?
-
Tags can be used to enrich each query with unique information.
See
https://www.elastic.co/guide/en/app-search/current/tags.html
no setterinherited -
copyWith
→ $ElasticQueryCopyWith<
ElasticQuery> -
no setterinherited
-
disjunctiveFacets
→ List<
String> ? -
Disjunctive facets are useful when you have many filters in your form, and especially
when you filter your query with a value that corresponds to a facet: if a disjunctive facet is set,
it will return all the available facets as if that filter was not applied.
This is not a native part of Elastic App Search, this is a workaround. In fact, multiple queries are
passed to Elastic and the package concatenates all responses in one response.
no setterinherited
- engine → ElasticEngine?
-
An object representing an Elastic engine
no setterinherited
-
facets
→ Map<
String, _ElasticQueryFacet> ? -
Facets are objects which provide the counts of each value or range of values for a field.
See
https://www.elastic.co/guide/en/app-search/current/facets.html
no setterinherited -
filters
→ List<
_ElasticSearchFilter> ? -
Object to filter documents that contain a specific field value.
See
https://www.elastic.co/guide/en/app-search/current/filters.html
no setterinherited - groupBy → _ElasticGroup?
-
Grouped results based on shared fields
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- precisionTuning → int?
-
Use the precision parameter of the search API to tune precision
and recall for a query. Learn more in Precision tuning (beta).
See
https://www.elastic.co/guide/en/app-search/current/search-api-precision.html
no setterinherited - query → String
-
String or number to match.
no setterinherited
-
resultFields
→ List<
_ElasticResultField> ? -
Object to define the fields which appear in search results and how their values are rendered.
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
- searchPage → _ElasticSearchPage?
-
Object to delimit the pagination parameters.
no setterinherited
-
sortBy
→ List<
_ElasticSort> ? -
Object to sort your results in an order other than document score.
no setterinherited
Methods
-
disjunctiveFacet(
String field) → ElasticQuery - Creates and returns a new ElasticQuery with additional disjunctive facet.
-
facet(
String field, {String? name, Object? isGreaterThanOrEqualTo, Object? isLessThan, Object? isFurtherThanOrAt, Object? isLessFarThan, LatLong? from, GeoUnit? unit, int? size}) → ElasticQuery -
Creates and returns a new ElasticQuery with additional ElasticFacet, an object
which rovides the counts of each value for a field, or counts of documents within the provided ranges
if
isMoreThanOrEqualTo
orisLessThan
is provided. -
filter(
String field, {Object? isEqualTo, List< Object?> ? whereIn, Object? isGreaterThanOrEqualTo, Object? isLessThan, double? isFurtherThanOrAt, double? isLessFarThan, LatLong? from, GeoUnit? unit}) → ElasticQuery -
Creates and returns a new ElasticQuery with additional
ElasticSearchFilter
, an object to filter documents that contain a specific field value. Available on text, number, and date fields. -
filterAny(
String field, {Object? isEqualTo, List< Object?> ? whereIn, Object? isGreaterThanOrEqualTo, Object? isLessThan, double? isFurtherThanOrAt, double? isLessFarThan, LatLong? from, GeoUnit? unit}) → ElasticQuery -
Creates and returns a new ElasticQuery with additional
ElasticSearchFilter
, an object to filter documents that contain a specific field value. Available on text, number, and date fields. -
filterNone(
String field, {Object? isEqualTo, List< Object?> ? whereIn, Object? isGreaterThanOrEqualTo, Object? isLessThan, double? isFurtherThanOrAt, double? isLessFarThan, LatLong? from, GeoUnit? unit}) → ElasticQuery -
Creates and returns a new ElasticQuery with additional
ElasticSearchFilter
, an object to filter documents that contain a specific field value. Available on text, number, and date fields. -
get(
[CancelToken? cancelToken]) → Future< ElasticResponse> - Fetch the documents for this query.
-
group(
String field, {int? size}) → ElasticQuery -
Takes a field with an optionnal
size
, creates and returns a new ElasticQuery which will return grouped results based on shared fields. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
page(
int current, {int size = 10}) → ElasticQuery - Creates and returns a new ElasticQuery with new pagination parameters.
-
precision(
int value) → ElasticQuery -
Takes a precision int, creates and returns a new ElasticQuery
See
https://www.elastic.co/guide/en/app-search/current/search-api-precision.html
The value of the precision parameter must be an integer between 1 and 11, inclusive. The range of values represents a sliding scale that manages the inherent tradeoff between precision and recall. Lower values favor recall, while higher values favor precision. -
resultField(
String field, {int? rawSize, int? snippetSize, bool fallback = true}) → ElasticQuery -
Creates and returns a new ElasticQuery with additional
ElasticResultField
, an object which defines the fields which appear in search results and how their values are rendered. -
searchField(
String field, {int? weight}) → ElasticQuery -
Takes a field with an optionnal
weight
, creates and returns a new ElasticQuery -
sort(
String field, {bool descending = false}) → ElasticQuery -
Takes a field with an optionnal
descending
, creates and returns a new ElasticQuery which will sort your results in an order other than document score. -
tag(
String tag) → ElasticQuery - Creates and returns a new ElasticQuery with additional analytics tag.
-
toJson(
) → Map< String, dynamic> -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited