I think your query is not right.
if you have must clauses in boolquery, then should clauses are not required.
So in this case, all documents with status 0 are returned.
If that's right,
may be you can try: boolquery.minimumNumberShouldMatch
or may be you can use bool[must status,must[bool[should sex, should name]]]
I'm not sure if the first choice works, but you can try.
BTW: how to input a code box like that in your post?... two `` is just a simple format
It's similar with the previous one.
I think you need to read the documents about booleanquery in lucene carefully, so that you can understand what's
must clause, and what's should, mustnot.
booleanquery is not logistic and/or. It's something a little different.
The simplest usage of booleanquery is:
in each query, all the clauses are must or all should.
in this way, it works like and, or.
The query with only must clauses is A AND B AND C ..
and with should is A OR B OR C..
and than you can combine several bools together.
If you want to use must and should together in one query, you must understand the mechanism of booleanquery clearly. Otherwise, you just make some mistake..
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.