Skip to content

Commit

Permalink
Simplify condition
Browse files Browse the repository at this point in the history
  • Loading branch information
LoayGhreeb committed Jan 10, 2025
1 parent 5fd0c53 commit f7bc3f8
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,12 @@ public SqlQueryNode visitComparison(SearchParser.ComparisonContext ctx) {

// field = "" -> should find entries where the field is empty
// field != "" -> should find entries where the field is not empty
if (term.isEmpty() && searchFlags.contains(NEGATION)) {
searchFlags.remove(NEGATION);
} else if (term.isEmpty()) {
searchFlags.add(NEGATION);
if (term.isEmpty()) {
if (searchFlags.contains(NEGATION)) {
searchFlags.remove(NEGATION);
} else {
searchFlags.add(NEGATION);
}
}

return getFieldQueryNode(field.toLowerCase(Locale.ROOT), term, searchFlags);
Expand Down

0 comments on commit f7bc3f8

Please sign in to comment.