-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Deprecate unindexed phrases #31072
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
Deprecate unindexed phrases #31072
Conversation
Pinging @elastic/es-search-aggs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should move the phraseQuery
factory method to StringFieldType
rather than TextFieldType
so that phrase queries on keyword
fields keep failing the same way as before?
|
||
public Query multiPhraseQuery(String field, TokenStream stream, int slop, boolean enablePositionIncrements) throws IOException { | ||
throw new IllegalArgumentException("Can only use phrase queries on text fields - not on [" + name + "] which is of type [" + typeName() + "]"); | ||
public Query multiPhraseQuery(String field, TokenStream stream, int slop, boolean enablePositionIncrements, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could use a static deprecation logger instead of requiring callers to pass one?
I think phrase queries on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If that's the case then LGTM. Thanks @romseygeek.
@elasticmachine retest this please |
run gradle build tests |
Companion issue to #31060 for the 6.x branch. Instead of throwing an exception, a deprecation warning is logged and a MatchNoDocsQuery is returned.