Closed alkaitagi closed 3 years ago
I am just starting to implement Algolia in my app.
Array in my document will be like this: ["#tag11", "#tag12", "tag3", "tag4"]
I want to implement search suggestions like: #tag1
will give ["#tag11", "#tag12"]
as it's result.
Is this issue related to it or is it related to further filtering in final results?
I want to implement search suggestions like:
#tag1
will give["#tag11", "#tag12"]
as it's result.
Yes, your case is what I wanted to implement but couldn't due to this issue.
Okay. Thanks for the information. I have implemented Algolia in my app and considering the above example, #tag1
is returning a list of hits considering both the cases. But It will be a very big list and I will have to filter them manually in my app.
This was integrated into master
in https://github.com/knoxpo/dart_algolia/commit/9e60161ac9db790b9cf84be276649d1ce9344454.
The maintainer is not properly attributing PRs / addressing issues and instead just takes code from PRs and integrates it into master
without notice. I just wanted to let you know that this issue has been fixed.
Great to hear. I will test within a week and then update the issue accordingly.
@creativecreatorormaybenot finally got to test the feature:
_index.facetQuery(
'tags',
facetQuery: 'n',
)
.then((v) => print('TAG $v'));
And run into the error:
D/FirebaseAuth(17228): Notifying id token listeners about user ( Nd95yzHl7eYYj6hkqK38q65sTD32 ).
E/flutter (17228): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Bad state: Cannot set the body fields of a Request with content-type "application/json".
E/flutter (17228): #0 Request.bodyFields=
package:http/src/request.dart:133
E/flutter (17228): #1 BaseClient._sendUnstreamed
package:http/src/base_client.dart:87
E/flutter (17228): #2 BaseClient.post
package:http/src/base_client.dart:32
E/flutter (17228): #3 post.<anonymous closure>
package:http/http.dart:69
E/flutter (17228): #4 _withClient
package:http/http.dart:164
E/flutter (17228): #5 post
package:http/http.dart:68
E/flutter (17228): #6 AlgoliaIndexReference.facetQuery
package:algolia/src/index_reference.dart:81
Even _index.facetQuery('tags').then((v) => print('TAG $v'));
gives the same error. And yes, I've set searchable(tags)
, and the facet search works on JS.
In this package it fails at
var url =
'${algolia._host}indexes/$encodedIndex/facets/${Uri.encodeFull(facetName)}/query';
var response = await http.post(
Uri.parse(url),
headers: algolia._headers,
body: {
'params': params,
'facetQuery': facetQuery,
'maxFacetHits': maxFacetHits,
},
);
Meaning that the request doesn't even leave the client.
@alkaitagi nice that you got to test it. I did not implement it, so I cannot help you there. But you should be able to file a new issue / create a PR and with a lot of luck, @nhathiwala will take a look at it.
@creativecreatorormaybenot For me, implementation of this feature is no longer a high priority in my project, so I move on for a while. I close the issue as technically it is implemented, and the new one, as you've said, would be a bug one. When I come at this feature again, if not fixed by then, I will open a new issue and will help to resolve it. For now, thank you for your work!
Is your feature request related to a problem? Please describe. It seems like the searchForFaceValues method is not supported. Having this is very important for me as I need to implement tags autocompletion.
Describe the solution you'd like Right now the
query
method performs the search only over the record objects. Perhaps another method is needed, something likequeryFacets
that would allow for the facet filtering.Describe alternatives you've considered I've tried using
setFacets
method, but it retrieves all the values, which will be thousands. I only need a few tags that start with a text I want to perform a search with.