elastic_app_search
1.0.0, released 6 months ago by julienlebren.dev
Dart/Flutter client for Elastic App Search API
WASM-ready
What it does
Provides a simple, type‑safe API to query Elastic App Search, filter results, and access metadata. It wraps HTTP calls and returns easy‑to‑use objects.
AI-written summary of version 1.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to integrate Elastic App Search into a Flutter app
- You want a fluent query builder with filters, facets, and pagination
- You prefer a single package that covers all App Search endpoints
Skip it when
- You don't have an Elastic App Search deployment
- You need offline or local search capabilities
Strengths
- Full native endpoint coverage for engine, account, and crawler APIs
- Fluent query syntax with filters, facets, and pagination
- Strong request validation and error mapping
- Built with Dio for robust networking
Weaknesses
- Requires an active Elastic deployment
- No offline support
- Relies on Dio, so adding it to a project adds a dependency
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- Yes (build_runner)
- Direct dependencies
- 4
Create an ElasticAppSearch instance with endpoint and searchKey, then call engine("name").query("term")…
final service = ElasticAppSearch(
endPoint: "https://host-2376rb.api.swiftype.com",
searchKey: "search-371auk61r2bwqtdzocdgutmg",
);
ElasticResponse response = await service
.engine("search-ui-examples")
.query("mountains")
.filter("states", isEqualTo: "California")
.filter("world_heritage_site", isEqualTo: true)
.resultField("title")
.resultField("description", snippetSize: 140)
.page(1, size: 50)
.get();Works with
Packages commonly used together with elastic_app_search: ones it builds on, ones built on it, and its own family.
- json_annotationelastic_app_search depends on itProvides annotations for json_serializable to generate JSON (de)serialization code.
- dioelastic_app_search depends on itA powerful HTTP networking package for Dart and Flutter with interceptors and request cancellation.
- freezed_annotationelastic_app_search depends on itAnnotations for the freezed code-generator.
- html_unescapeelastic_app_search depends on itUn-escapes HTML-encoded strings supporting named, decimal, and hexadecimal character references.