-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Finding documents with empty string as value #7515
Comments
Hi Paulo and everyone, I just ran a few tests and also have same questions about it. On the ES 1.3.2, the empty string cannot be find and the gist above can only find one document But on the ES 1.0.1, the final result of the gist can both find the empty-string and null-value documents. Also its explanation is It seems the parsing rule changed, Any ideas? |
I think this is a duplicate of #7348 ? |
Hi @jprante, Yes, I think so. |
Does adding an |
Here's a workaround:
Not optimal, but it works |
You're a life saver @clintongormley |
I want to do the inverse of this: "query": {
"bool": {
"filter": {
"wildcard": {
"name": "*"
}
}
} And it appears to work. Any document with a name matches and any doc with null or '' name does not match. But I don't know why it works! I thought that the wildcard filter expands * to some number of terms so that if I have, say, 9999 terms in the name field, if I index a document with name = "zzzzzzzzzzzzebra" then that will be well past the term expansion and it shouldn't match. But it does. Why? Somehow I guess it's doing the |
Now it's 2020. Still not found a better solution for "field is not the empty string".
|
hi, bool query with regexp works well for me
|
Hello,
I've been trying to find all documents that contains a field with an empty string value (
_textContent
) inside my index using themissing
filter. But I think that this filter doesn't treat empty strings as a null value.Is this a bug, or the intended behavior for this filter? If it is like this by design, may I suggest adding an
empty
filter, if that's even possible?As a plus, I'll post the mapping that I'm currently using, the document that contains the empty string field and the query that I'm trying to run:
Mapping:
Document:
Query:
Thanks a lot for the amazing tool developed here!
The text was updated successfully, but these errors were encountered: