OpenSearchProvider<TModel, TFacets> class

OpenSearch and Elasticsearch, which share this query API.

Three things differ from the other hosted providers, and each is translated here so callers see one contract: paging is offset-based (from/size) rather than page numbers, hits are nested under hits.hits[]._source, and the total is an object on 7.x but a bare integer on 6.x.

Inheritance

Constructors

OpenSearchProvider({required Uri baseUrl, required String indexName, required TModel fromJson(Map<String, Object?> hit), String apiKey = '', List<String> searchFields = const <String>['*'], List<String> facetFields = const <String>[], DVSearchTuning tuning = const DVSearchTuning(), String? username, String? password, DVSearchFacetFilter<TFacets>? facetFilter, DVHttpSend transport = dvSendHttpRequest})
const

Properties

apiKey → String
finalinherited
baseUrl → Uri
finalinherited
facetFields → List<String>
Keyword fields to aggregate on for counts.
final
facetFilter → DVSearchFacetFilter<TFacets>?
finalinherited
fromJson → TModel Function(Map<String, Object?> hit)
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
indexName → String
finalinherited
password → String?
final
providerName → String
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
searchFields → List<String>
Fields to match against. ['*'] searches every indexed field.
final
transport → DVHttpSend
finalinherited
tuning → DVSearchTuning
Supplies the highlight markers; the engine does the matching.
final
username → String?
final

Methods

buildRequest(String query, List<String> filters, int page, int perPage) → DVHttpRequest
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
query(String query, {TFacets? facets, int page = 1, int perPage = 20}) → Future<DVSearchResultPage<TModel>>
inherited
readHits(Map<String, Object?> payload, String key) → List<TModel>
inherited
readResponse(Map<String, Object?> payload, int page, int perPage) → DVSearchResultPage<TModel>
override
toString() → String
A string representation of this object.
inherited

Operators

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