Skip to content

Commit

Permalink
Spotless
Browse files Browse the repository at this point in the history
Signed-off-by: Harsha Vamsi Kalluri <[email protected]>
  • Loading branch information
harshavamsi committed Jan 19, 2024
1 parent 7ee0f4f commit 7c14aeb
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
import org.apache.lucene.search.MatchNoDocsQuery;
import org.apache.lucene.search.MultiTermQuery;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.TermInSetQuery;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.TermRangeQuery;
import org.apache.lucene.util.BytesRef;
Expand Down Expand Up @@ -292,12 +291,13 @@ public Query termQuery(Object value, QueryShardContext context) {
public Query termsQuery(List<?> values, QueryShardContext context) {
failIfNotIndexedAndNoDocValues();
// if we do not get either True or False, we return no docs
if (!(values.contains(Values.TRUE)) || !(values.contains(Values.FALSE))){
if (!(values.contains(Values.TRUE)) || !(values.contains(Values.FALSE))) {
return new MatchNoDocsQuery("Values do not contain True or False");
}
// if we have either True or False, we delegate to termQuery
if((values.contains(Values.TRUE) && !(values.contains(Values.FALSE))) || (values.contains(Values.FALSE) && !values.contains(Values.TRUE))){
return termQuery(values.contains(Values.TRUE)? Values.TRUE : Values.FALSE, context);
if ((values.contains(Values.TRUE) && !(values.contains(Values.FALSE)))
|| (values.contains(Values.FALSE) && !values.contains(Values.TRUE))) {
return termQuery(values.contains(Values.TRUE) ? Values.TRUE : Values.FALSE, context);
}
// if we have both True and False, we acknowledge that the field exists with a value
return new FieldExistsQuery(name());
Expand Down

0 comments on commit 7c14aeb

Please sign in to comment.