Empty terms for Terms Filter in 0.21

Hello,

I've been trying out the new beta version of ES and I've got a question.

Version 0.19.x allowed us to provide an empty set of Terms for Terms Filter:

{
"constant_score" : {
"filter" : {
"terms" : { "user" : []}
}
}
}

and now, in 0.21 it is forbidden, ES throws IllegalArgumentException[no
terms provided].

Is that intended?

Regards,
Paweł Młynarczyk

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Yes, it's result of this
change: [LUCENE-4511] TermsFilter might return wrong results if a field is not indexed or not present in the index - ASF JIRA

On Friday, February 1, 2013 11:04:34 AM UTC-5, Paweł Młynarczyk wrote:

Hello,

I've been trying out the new beta version of ES and I've got a question.

Version 0.19.x allowed us to provide an empty set of Terms for Terms
Filter:

{
"constant_score" : {
"filter" : {
"terms" : { "user" : }
}
}
}

and now, in 0.21 it is forbidden, ES throws IllegalArgumentException[no
terms provided].

Is that intended?

Regards,
Paweł Młynarczyk

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

What do you expect when providing an empty array, do you mean to find documents that have no values for user? We have the missing filter for it, but we could identify an empty array and automatically do a "missing" filter in that case.

On Feb 1, 2013, at 5:04 PM, Paweł Młynarczyk zwarios@gmail.com wrote:

Hello,

I've been trying out the new beta version of ES and I've got a question.

Version 0.19.x allowed us to provide an empty set of Terms for Terms Filter:

{
"constant_score" : {
"filter" : {
"terms" : { "user" : }
}
}
}

and now, in 0.21 it is forbidden, ES throws IllegalArgumentException[no terms provided].

Is that intended?

Regards,
Paweł Młynarczyk

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

I created a Pull Request here: When termsFilter is empty, use missingFilter instead by dadoonet · Pull Request #2613 · elastic/elasticsearch · GitHub

David.

Le 2 févr. 2013 à 23:07, kimchy@gmail.com a écrit :

What do you expect when providing an empty array, do you mean to find documents that have no values for user? We have the missing filter for it, but we could identify an empty array and automatically do a "missing" filter in that case.

On Feb 1, 2013, at 5:04 PM, Paweł Młynarczyk zwarios@gmail.com wrote:

Hello,

I've been trying out the new beta version of ES and I've got a question.

Version 0.19.x allowed us to provide an empty set of Terms for Terms Filter:

{
"constant_score" : {
"filter" : {
"terms" : { "user" : }
}
}
}

and now, in 0.21 it is forbidden, ES throws IllegalArgumentException[no terms provided].

Is that intended?

Regards,
Paweł Młynarczyk

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

I think that using missingFilter when termsFilter has empty terms list is
misleading.
I understand termsFilter like: return only those documents, where a field
has one of the values provided as terms.
So empty terms list in termsFilter == doesn't return anything ==
notFilter(matchAllFilter()).
Also notFilter(termsFilter with empty terms list) == matchAllFilter.

I use this behaviour of ES 0.19 to exclude some documents from results:
notFilter(termsFilter("documentType", ))
If is empty then all documents should be
returned.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

On Mon, 2013-02-04 at 02:40 -0800, Wojciech Durczyński wrote:

I think that using missingFilter when termsFilter has empty terms list
is misleading.

I agree.

I understand termsFilter like: return only those documents, where a
field has one of the values provided as terms.
So empty terms list in termsFilter == doesn't return anything ==
notFilter(matchAllFilter()).
Also notFilter(termsFilter with empty terms list) == matchAllFilter.

I understand it differently. Giving that you are filtering documents, a
filter with no terms for me means: don't filter on anything, so give me
all docs, ie match_all

clint

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.