-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[BUG] Token Filter Order: word_delimiter_graph and synonym_graph #16263
Comments
Hi,
I was able to create the index, but while indexing the document I got the below error
which is already mentioned under: https://discuss.elastic.co/t/word-delimiter-graph-token-synonym-graph-token/278942
I was able to create index and finish indexing, but when I tried querying I wasn’t getting the current result Result:
Expected result:
Please let me know if you have any other recommendation. Thanks, |
Hi there -- the issue here is that the We could add a configuration setting to |
Hi Michael, Do you know how soon can this be implemented? Will I be able to specify the word_delimeter_filter before the synonym graph filter with this approach? Thanks, |
Hey, I was experimenting with the issue to understand the error better, and as suggested by @msfroh I've added a new configuration setting Here’s the output I’ve observed. Query
Output
Query
Output
@nupurjaiswal @aswad1 can you please confirm if the query and the output is as expected ? If you have any additional queries to test this behaviour please share. Thank you |
Some more tests which works as expected.
When used custom
|
[Catch All Triage - 1, 2, 3] |
@prudhvigodithi The mapping you posted earlier with "synonym_analyzer": "standard" is not working. I am getting the error "Token filter [custom_word_delimiter] cannot be used to parse synonyms" |
Hey @nupurjaiswal, did you try to build OpenSearch from my fork and test it? I have created a draft PR #16488 with the proposal to use |
@prudhvigodithi I was using Opensearch on AWS. I am not running opensearch locally. I cloned your project from here: https://github.com/prudhvigodithi/OpenSearch/tree/bug-fix-synonym and tried to use "gradlew assemble", but I am facing errors while building it. Can you please share the instruction on how to build and run Opensearch using your fix? That would be helpful |
Hey @nupurjaiswal sure,
Once started you can run your Also FYI I got some feedback on the PR, will take a look address the comments. |
Hi @prudhvigodithi I followed for your instruction: Cloned the repo "https://github.com/prudhvigodithi/OpenSearch.git", Installed java 21, followed your command build and run opensearch. The build was successful. I used postman to do the PUT query, I am still getting the below issue:
|
Hey @nupurjaiswal can you please confirm you tried with |
Thanks a lot, @prudhvigodithi. I realized I was on the wrong branch, but I was able to create the index and test queries once I switched to your branch. Your fix solved the issue. I will continue with the remaining testing and keep you updated. |
Describe the bug
I am migrating from Solr to OpenSearch and need to maintain the same analyzer behavior that I had in Solr, where the word_delimiter_graph filter is applied before the synonym expansion.
In Solr, this order worked without issues, and I used FlattenGraphFilterFactory to handle token graph flattening after synonym processing. I need to maintain this specific order to keep consistent search behavior during the migration. Any guidance or suggestions would be greatly appreciated.
Solr schema:
OpenSearch mapping, where I am facing the error for the analyzer "text_en_index" and "text_en_query":
In OpenSearch, when I try to apply the word_delimiter_graph filter before the synonym_graph filter (as required by my use case), I receive the following error:
Question:
Related component
Other
To Reproduce
N/A
Expected behavior
N/A
Additional Details
Plugins
Please list all plugins currently enabled.
Screenshots
If applicable, add screenshots to help explain your problem.
Host/Environment (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: