algolia_lite 0.1.0
algolia_lite: ^0.1.0 copied to clipboard
Dart API client to interact with Algolia, designed for client apps.
Algolia Dart API Client Lite #
Dart API client to interact with Algolia, designed for client apps.
💡Getting Started #
Create an instance of SearchClient:
var client = SearchClient(
applicationID: 'MyApplicationID',
apiKey: 'MyApiKey',
);
Use your search client instance to make API requests:
Search index
var request = SearchRequest.create(
indexName: 'MyIndexName',
params: {'query': 'phone'},
);
var response = await client.search(request);
Search multiple indices
var request = MultiSearchRequest(requests:
[
SearchRequest.create(indexName: 'MyIndexName1', params: params),
SearchRequest.create(indexName: 'MyIndexName2', params: params),
],
);
var response = await client.multiSearch(request);
Search for facet values
var request = FacetSearchRequest(
indexName: 'MyIndexName',
facetName: 'categories',
facetQuery: 'phone',
);
var response = await client.facetsSearch(request);
Get object(s)
var request = ObjectRequest(
indexName: 'MyIndexName',
objectID: 'MyObjectID',
attributes: ['email', 'name'],
);
var objectResponse = await client.object(request);
final response = await client.objects(
[
ObjectRequest(indexName: 'MyIndexName1', objectID: 'MyObjectID1'),
ObjectRequest(indexName: 'MyIndexName1', objectID: 'MyObjectID2'),
],
);
Browse index
var request = SearchRequest('MyIndexName');
var stream = client.browse(request);
await for (var response in stream) {
print(response);
}
📄 License #
Algolia Dart API Client Lite is an open-sourced software licensed under the MIT license. This is an unofficial library, it is not affiliated with nor endorsed by Algolia. Contributions are welcome.