-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rerun of the search request #86
Comments
I am facing the same issue. |
As a workaround, you can add a space to your query if it is the same as the last one, and it will be handled like a new search and return the expected result |
Hi @Ragnarokr45, @MaximusAshraf99, Apologies for the late response. We have a unit test that verifies the expected behavior of the rerun method. To further investigate, could you set up a basic test on your end? Here's what you'd need to do:
This test procedure might be structured like this: final searcher = HitsSearcher(
applicationID: 'your_app_id',
apiKey: 'your_api_key',
indexName: 'your_index',
);
final responses = <SearchResponse>[];
searcher.responses.listen(responses.add);
for (var i = 0; i < 3; i++) {
searcher.query('sony');
await Future.delayed(const Duration(milliseconds: 500));
}
expect(
responses.length,
1,
reason: 'Only one response should be emitted for duplicate queries',
);
searcher.rerun();
await Future.delayed(const Duration(milliseconds: 500));
expect(
responses.length,
2,
reason: '2 responses should be emitted after rerun',
); If this test works as expected and you receive two responses, it indicates that the functionality is operating correctly. In such a case, I would recommend reviewing your implementation to pinpoint potential discrepancies that might be causing different behavior in your environment. |
I'm facing the same issue, here my workaround: NOT working hitsSearcher.applyState((state) => state.copyWith(
page: page,
hitsPerPage: pageSize,
));
hitsSearcher.rerun();
//or
hitsSearcher.applyState((state) => state.copyWith(
query: state.query,
page: page,
hitsPerPage: pageSize,
)); working hitsSearcher.applyState((state) => state.copyWith(
query: "${state.query ?? ""} ",
page: page,
hitsPerPage: pageSize,
)); The listen callback of hitsSearcher.responses is not triggered when using |
Describe the bug 🐛
Im faced with issue when Im sending the same search query using
'searcher.rerun()'
method Im not receiving any results, and it can only be fixed by sending another request with new text. It was working while ago but now it's not. I also tried to do it withsearcher.query('query')
method but it's also not workingTo Reproduce 🔍
Steps to reproduce the behavior:
Expected behavior 💭
Receiving search results after sending the same search query again
Screenshots 🖥
Environment:
Additional context
The text was updated successfully, but these errors were encountered: