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
Lessen leniency of the query dsl. #18276
Conversation
If this change is approved I'll work on adding deprecation warnings on 2.x. |
public abstract class StringFieldType extends TermBasedFieldType { | ||
|
||
public StringFieldType() { | ||
super(); |
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.
Having an empty ctor body will also use the default super ctor, so I think this super() is not necessary?
LGTM, I left a couple minor comments. |
This change does the following: - Queries that are currently unsupported such as prefix queries on numeric fields or term queries on geo fields now throw an error rather than returning a query that does not match anything. - Fuzzy queries on numeric, date and ip fields are now unsupported: they used to create range queries, we now expect users to use range queries directly. Fuzzy, regexp and prefix queries are now only supported on text/keyword fields (including `_all`). - The `_uid` and `_id` fields do not support prefix or range queries anymore as it would prevent us to store them more efficiently in the future, eg. by using a binary encoding. Note that it is still possible to ignore these errors by using the `lenient` option of the `match` or `query_string` queries.
a847fb3
to
864ed04
Compare
@clintongormley just informed me that removing the support for fuzzy queries on numeric fields in query strings had been previously rejected in #4076. @kimchy Do you still have concerns about stopping to support fuzzy queries on numeric/date/ip fields? |
@danielmitterdorfer If my understanding is correct, the concern is more about removing support for the fuzzy operator |
@jpountz Ok, I was just double-checking. |
@jpountz I find the ability to use the fuzzy operator in a query string to be simpler to use in things like Kibana query string and so on. Is there a reason you want to remove it? I always viewed it as a "range query" operator, just apply to other types. To me, it does make sense to have |
First I wanted to remove it for ip addresses since it does not make much sense now that we support ipv6 (the deltas would need to be huge for it to be useful). So then I questioned whether this is useful at all on numeric/date fields and I could not remember of any bug/discussion about this feature, even though it certainly has bugs (for instance, it did not check for overflows). So I am leaning towards removing it, especially given that the range is easy to type too, and this gives us a single way to search ranges of values, which I think prevents confusion. |
Adrien, lead the way :) |
This is a follow-up to elastic#18276.
This change does the following:
fields or term queries on geo fields now throw an error rather than returning
a query that does not match anything.
to create range queries, we now expect users to use range queries directly.
Fuzzy, regexp and prefix queries are now only supported on text/keyword
fields (including
_all
)._uid
and_id
fields do not support prefix or range queries anymore asit would prevent us to store them more efficiently in the future, eg. by
using a binary encoding.
Note that it is still possible to ignore these errors by using the
lenient
option of the
match
orquery_string
queries.