Fixes bugs from word delimiter graph filter#184
Open
mboynes wants to merge 1 commit intoAutomattic:developfrom
Open
Fixes bugs from word delimiter graph filter#184mboynes wants to merge 1 commit intoAutomattic:developfrom
mboynes wants to merge 1 commit intoAutomattic:developfrom
Conversation
|
If I'm understanding the discussion on the linked PR, looks like a full solution hasn't been merged upstream yet. |
Author
|
@rebeccahum correct. And it's unclear as of yet if the likely response (adding default_search analyzers separate from the default indexing analyzers) will actually address the issue, or just work around it for the only "out-of-the-box" feature a user can enable, synonyms. Separating search and index analyzers still requires changing this setting for indexing operations. At the risk of being a broken record, the current configuration is invalid, and creates a problem regardless of whether or not something else (such as search-as-you-type, synonyms, highlighting, etc.) surfaces it. |
dc6742b to
5c91c11
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
VIP: This was PRed upstream, though it was closed. I would encourage VIP to adopt this change in your fork regardless.
Description
This removes the
preserve_originaloption for theword_delimiter_graphtoken filter. As noted in the ES docs:As it was set, this was producing multi-position tokens, which could lead to unexpected results and, potentially, indexing errors. Where I observed this specifically was using a
search_as_you_typefield. This uses shingle token filters to create 2- and 3-gram sub-fields. Combined withword_delimiter_graph.preserve_original = true, if the field text is a word like "WordPress", and the analyzed token count is <= the gram size, the tokens can end up with a negative token position and indexing fails.For what it's worth, I tried using
flatten_graphas the docs suggest as a workaround, and that didn't work 🤷.Checklist
Please make sure the items below have been covered before requesting a review:
Steps to Test
To replicate the error in isolation:
Observe that when removing
"preserve_original": true, the document indexes as expected and the position is correctly calculated as 0, not -1.