File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change 1
- import 'package:algolia/algolia.dart' show Algolia, AlgoliaQuerySnapshot;
1
+ import 'package:algolia/algolia.dart'
2
+ show Algolia, AlgoliaQuery, AlgoliaQuerySnapshot;
2
3
3
4
import '../constants/config.dart' ;
4
5
import '../models/search_result.dart' ;
@@ -11,12 +12,14 @@ class AlgoliaSearch {
11
12
apiKey: Config .algoliaSearchOnlyApiKey,
12
13
);
13
14
14
- static Future <AlgoliaQuerySnapshot > query (String queryString) async =>
15
- _algolia.instance
16
- .index (Config .algoliaSearchIndex)
17
- .query (queryString)
18
- .setAttributesToRetrieve (SearchResult .attributesToRetrieve)
19
- .setPage (0 )
20
- .setHitsPerPage (20 )
21
- .getObjects ();
15
+ static Future <AlgoliaQuerySnapshot > query (String queryString) async {
16
+ final AlgoliaQuery query = _algolia.instance
17
+ .index (Config .algoliaSearchIndex)
18
+ .query (queryString)
19
+ .setAttributesToRetrieve (SearchResult .attributesToRetrieve)
20
+ .setPage (0 )
21
+ .setHitsPerPage (20 );
22
+
23
+ return await query.getObjects ();
24
+ }
22
25
}
You can’t perform that action at this time.
0 commit comments