-
Notifications
You must be signed in to change notification settings - Fork 24.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
Allow non-exact query types on the root JSON field. #41290
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -315,23 +315,23 @@ public Query rangeQuery(Object lowerTerm, | |
@Override | ||
public Query fuzzyQuery(Object value, Fuzziness fuzziness, int prefixLength, int maxExpansions, | ||
boolean transpositions) { | ||
throw new UnsupportedOperationException("[fuzzy] queries are not currently supported on [" + | ||
CONTENT_TYPE + "] fields."); | ||
throw new UnsupportedOperationException("[fuzzy] queries are not currently supported on keyed " + | ||
"[" + CONTENT_TYPE + "] fields."); | ||
} | ||
|
||
@Override | ||
public Query regexpQuery(String value, int flags, int maxDeterminizedStates, | ||
MultiTermQuery.RewriteMethod method, QueryShardContext context) { | ||
throw new UnsupportedOperationException("[regexp] queries are not currently supported on [" + | ||
CONTENT_TYPE + "] fields."); | ||
throw new UnsupportedOperationException("[regexp] queries are not currently supported on keyed " + | ||
"[" + CONTENT_TYPE + "] fields."); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, just adding the field prefix should work ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you think it'd make sense to automatically adjust There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's keep the value as is, the field name shouldn't consume a lot of states and the current limit is already high ( |
||
} | ||
|
||
@Override | ||
public Query wildcardQuery(String value, | ||
MultiTermQuery.RewriteMethod method, | ||
QueryShardContext context) { | ||
throw new UnsupportedOperationException("[wildcard] queries are not currently supported on [" + | ||
CONTENT_TYPE + "] fields."); | ||
throw new UnsupportedOperationException("[wildcard] queries are not currently supported on keyed " + | ||
"[" + CONTENT_TYPE + "] fields."); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here ? |
||
} | ||
|
||
@Override | ||
|
@@ -517,28 +517,6 @@ public Query existsQuery(QueryShardContext context) { | |
} | ||
} | ||
|
||
@Override | ||
public Query fuzzyQuery(Object value, Fuzziness fuzziness, int prefixLength, int maxExpansions, | ||
boolean transpositions) { | ||
throw new UnsupportedOperationException("[fuzzy] queries are not currently supported on [" + | ||
CONTENT_TYPE + "] fields."); | ||
} | ||
|
||
@Override | ||
public Query regexpQuery(String value, int flags, int maxDeterminizedStates, | ||
MultiTermQuery.RewriteMethod method, QueryShardContext context) { | ||
throw new UnsupportedOperationException("[regexp] queries are not currently supported on [" + | ||
CONTENT_TYPE + "] fields."); | ||
} | ||
|
||
@Override | ||
public Query wildcardQuery(String value, | ||
MultiTermQuery.RewriteMethod method, | ||
QueryShardContext context) { | ||
throw new UnsupportedOperationException("[wildcard] queries are not currently supported on [" + | ||
CONTENT_TYPE + "] fields."); | ||
} | ||
|
||
@Override | ||
public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName) { | ||
failIfNoDocValues(); | ||
|
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.
I don't know what is your plan on this but it should be possible to allow this type of query by adding the field prefix in the fuzzy query and change the prefixLength to be
prefixLength + field.length + 1
?