I would like to ask how to use JAVA API in ES to query that the field value is an array type.

problem description

RT
ES structure is as follows:

{
"has_hot_act": 1, "tags": ["59224b430926a862244afc7b", "57faf0a10926a8459c6f1389"]
}
{
"has_hot_act": 1, "tags": [], act []
}
how to use ES java API to determine whether the array is empty and query the tag array?

the environmental background of the problems and what methods you have tried

I can"t find a lot of information on the Internet.

related codes

/ / Please paste the code text below (do not replace the code with pictures)
the method I try is
booleanQuery.mustNot (QueryBuilders.termQuery ("tags", "[]"));
booleanQuery.mustNot) (QueryBuilders.termQuery ("tags", new ArrayList < > ();
query array must not be empty, but still query the empty array.

what result do you expect? What is the error message actually seen?

I hope the great god will come out and give us some advice. I appreciate it.


Hello, I also encountered this problem. Have you solved


how do you solve it? I can't use matchQueryBuilder or prefixquerybuilder. Thank you very much

.
Menu