[ElasticSearch] Can't filter onAutocomplete results
Describe the bug
Can't filter onAutocomplete results, there is no mention in the docs, but the type definition allows me to add the filters. https://docs.elastic.co/search-ui/api/core/configuration#autocomplete-query
Question: The docs also mention a global queryConfig which could maybe solve/workaround my problem: https://github.com/elastic/search-ui/issues/890
To Reproduce Steps to reproduce the behavior:
Put this in results on autocompleteQuery for the search UI config
autocompleteQuery: {
results: {
filters: [{ field: "id", type: "all", values: ["park_wind-cave"] }],
https://codesandbox.io/s/nice-curie-fy9js1?file=/src/pages/elasticsearch/index.js
Note that in App Search this works fine! I tested both in the sandbox!
Expected behavior Only show autosuggestion with that id if not supported yet, don't add it to the type definition and make it clear in the docs.
Screenshots

Which backends and packages are you using: Backend: [Elasticsearch] Packages: [react-search-ui]
// frontend
"@elastic/react-search-ui": "^1.17.1",
"@elastic/react-search-ui-views": "^1.17.1",
"@elastic/search-ui": "^1.17.1",
// api
"@elastic/elasticsearch": "^8.2.1",
"@elastic/search-ui-elasticsearch-connector": "^1.17.1",
I looked into the package itself: It does look like there is no code related to filters at all in the autocomplete folder:
handlers/autocomplete/index.js
while in handlers/search there is something done with the filters object:
const baseFilters = buildBaseFilters(queryConfig.filters);
Great catch, again. I appreciate the bug report.
Hey @JasonStoltz, any timelines for getting this implemented?
In another thread, you mentioned that the filtering feature is not planned for App Search suggestions. Do you know if this also holds in the context of this bug report? If yes, is a workaround possible (within the context of using @elastic/react-search-ui)?
Cheers! ./.rc