algolia_helper 0.1.3 copy "algolia_helper: ^0.1.3" to clipboard
algolia_helper: ^0.1.3 copied to clipboard

discontinuedreplaced by: algolia_helper_flutter

Patterns and APIs to implement advanced search features with Algolia

example/example.dart

import 'package:algolia_helper/algolia_helper.dart';

void main() {
  // Create a hits searcher.
  // The Searcher performs search requests and obtains search result
  final searcher = HitsSearcher(
    applicationID: 'MY_APPLICATION_ID',
    apiKey: 'MY_API_KEY',
    indexName: 'MY_INDEX_NAME',
  );

  // Create the component to handle the filtering logic: FilterState.
  final group = FilterGroupID.and('products');
  final filterState = FilterState()
    ..add(group, {Filter.facet('genre', 'Comedy')})
    ..add(group, {Filter.range('rating', lowerBound: 3, upperBound: 5)});

  // Create a connection between the searcher and the filter state
  searcher.connectFilterState(filterState);

  // Run your search operations and listen the results!
  searcher.responses.listen((response) {
    print('${response.nbHits} hits found');
    for (var hit in response.hits) {
      print("> ${hit['title']}");
    }
  });

  searcher.query('a');
}
5
likes
0
pub points
29%
popularity

Publisher

verified publisheralgolia.com

Patterns and APIs to implement advanced search features with Algolia

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

algolia, collection, logging, meta, rxdart

More

Packages that depend on algolia_helper