-
Notifications
You must be signed in to change notification settings - Fork 367
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
[ElasticSearch] SearchTerm is ignored when adding a predefined filter to the search-ui config #892
Comments
Good catch, I appreciate the bug report. |
@ZakKa89 If you want to help us fix any of this... we are hiring :) |
hi there! Not sure if related, but we came to an interesting situation and it feels like the right issue to post this in. The filter we are applying looks like this:
Within the input that you can see in the video below, we would would like to allow users to further specify the results they are seeing by allowing them to set a search term on top of the pre-defined filters in the config. Just to clarify, this is the handler for setting the search term:
Combining this, we do actually see that setSearchTerm seems to be working, but it seems to sort the results rather than filtering out results that can be considered irrelevant by setting the searchTerm. Please note that the items you see in the video is the subset of our total index based on the pre-defined filters. setSearchTerm.mp4I've tried to debug the query that gets sent over to Elastic by logging the request body. The interesting part is that setting the search term (and filters) client side through the input onChange leads to quite a bit of a different query compared to the an initial query where filters + a search term is applied |
@RobbyUitbeijerse Your question is probably not related to my issue, but there's a difference between global filters (predefined) and filters for the user in the search UI config. The filters for the user are defined in the 'facets' object. I don't think you're using that. So I suggest to dive into the Facets configuration part of search-ui TLDR: You will need to add the filters that the user has control of to the config of Search-UI within the facets object |
My team is facing this issue as well. Have you found a solution or workaround for this? |
Just giving context on my previous comment. Not related to OP's issue. Elasticsearch connector's For some reason this is only relevant when global filters are applied through configuration. |
The searchTerm is still ignored if there is a global filter present. |
thanks, will put this under buglist. Happy to accept a PR for this too :) |
Describe the bug
SearchTerm is ignored when adding a predefined filter to the search-UI config. So doesn't matter what you search on, the search will just return the items from the predefined filters.
To Reproduce
https://codesandbox.io/s/github/elastic/search-ui/tree/master/examples/sandbox?file=/src/pages/elasticsearch/index.js:1108-1121
Note that for App Search this works fine!
///\\/\/\/\/\/\/\//\\\
You will see that you will still get the result of the filter...
Expected behavior
Which backends and packages are you using:
Backend: [Elastic Search cloud]
The text was updated successfully, but these errors were encountered: