Skip to content
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

MultiList issues two queries on first select #2301

Open
rgb-panda opened this issue Jun 25, 2024 · 3 comments
Open

MultiList issues two queries on first select #2301

rgb-panda opened this issue Jun 25, 2024 · 3 comments
Labels

Comments

@rgb-panda
Copy link

Affected Projects
React

Library Version: x.y.z
3.45.0

We have a ReactiveList and a MultiList where ReactiveList depends on MultiList.

When we select an item from MultiList for the first time, then there is two queries issued to elastic for the result.

The first query doesn't contain the selected value from MultiList, whereas the second one does. This issue becomes very problematic if the first query resolves before the second, as the result will be incorrect and it will be as-if the filter isn't selected.

Subsequent filter selects don't have this issue.

This issue is there in the sandbox provided in the documentation

https://docs.reactivesearch.io/docs/reactivesearch/react/v3/overview/quickstart/#step-5-adding-layout-and-styles

https://codesandbox.io/p/sandbox/github/appbaseio/reactivesearch/tree/v3/packages/web/examples/MyAwesomeSearchStep5?from-embed=

@rgb-panda rgb-panda added the bug label Jun 25, 2024
@rgb-panda
Copy link
Author

image

@rgb-panda
Copy link
Author

First query

"query":[{"id":"results","type":"search","dataField":["_score"],"execute":true,"react":{"and":["searchbox","authorsfilter","ratingsfilter","results__internal"]},"size":6,"from":0},{"id":"ratingsfilter","type":"range","dataField":["average_rating"],"execute":false,"react":{"and":"ratingsfilter__internal"},"value":{"start":4,"end":5,"label":"4 stars and up"}}]}'

Second Query

"query":[{"id":"results","type":"search","dataField":["_score"],"execute":true,"react":{"and":["searchbox","authorsfilter","ratingsfilter","results__internal"]},"size":6,"from":0},{"id":"authorsfilter","type":"term","dataField":["authors.keyword"],"execute":false,"react":{"and":"authorsfilter__internal"},"aggregationSize":5,"value":["Nora Roberts"]},{"id":"ratingsfilter","type":"range","dataField":["average_rating"],"execute":false,"react":{"and":"ratingsfilter__internal"},"value":{"start":4,"end":5,"label":"4 stars and up"}}]}'

@rgb-panda
Copy link
Author

@siddharthlatest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant