-
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] NPE happens on short prefix query on a field with index_prefixes
#2826
Comments
@woby looks like a bug - if you/someone wants to contribute a unit test for this we can fix it faster |
I took a stab at this to understand the problem. I did observe similar pattern as @woby. I did the tests and only 3. (min_chars -1) is seeing problems. Also a side note, Lucene throws a null pointer exception but OpenSearch handles it and does not crash. Which says, it only impacts this feature as a customer, but does not take down the cluster fatally. Setting up the index:
|
Thanks @VachaShah for taking care of this. @woby the changes are merged to 2.0 and will be available in the next release. |
Describe the bug
(
index_prefixes
is not documented in OpenSearch’s documentation but AFAIK OpenSearch is compatible with ElasticSearch 7.10, which has index_prefixes parameter.)When a
prefix
query run on a field withindex_prefixes
, if the length of characters in the query is [min_chars
of theindex_prefixes
option] - 1, an error is responded.The root cause seems to be NullPointerException.
To Reproduce
Steps to reproduce the behavior:
index_prefixes
option; itsmin_chars
is implicitly 2.prefix
query with one character on the field.Expected behavior
Run without errors. I know it is not efficient.
A similar
query_string
runs without any errors.I tried some patterns (
min_chars
= 2, 3, 5), and it seems that the prefix query with characters the length of which ismin_chars
- 1 fails. When the length is less thanmin_chars
- 1, the query succeeds.Plugins
N/A
Screenshots
N/A
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: