Skip to content

Commit

Permalink
[bug] il faut échapper le NOT
Browse files Browse the repository at this point in the history
  • Loading branch information
julg committed May 31, 2024
1 parent 7d80a74 commit 62908e3
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public class SearchQueryBuilder {
private FacetProps facetProps;

private Query buildQuery(String chaine) {
chaine = chaine.trim();
chaine = replaceAndOutsideQuotes(chaine);
chaine = replaceSpacesOutsideQuotes(chaine);

Expand Down Expand Up @@ -127,6 +128,10 @@ else if (c == ' ') {

result.append(" OR ");
i+= 3;
} else if (i + 3 < input.length() && input.charAt(i + 1) == 'N' && input.charAt(i + 2) == 'O' && input.charAt(i + 3) == 'T') {

result.append(" NOT ");
i+= 4;
} else if (!insideQuotes && !insideBrackets) {
result.append(" AND ");
} else {
Expand Down

0 comments on commit 62908e3

Please sign in to comment.