Skip to content

Commit

Permalink
just turn on split on whitespace when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
mdavis95 committed May 5, 2022
1 parent e560704 commit a799bb2
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public static void initAll() {

newParser = new ZuliaFlexibleQueryParser(zuliaPerFieldAnalyzer, serverIndexConfig);
oldParser = new ZuliaLegacyMultiFieldQueryParser(zuliaPerFieldAnalyzer, serverIndexConfig);
oldParser.setSplitOnWhitespace(true);
}

public static Query parse(String query, Collection<String> defaultFields, Operator defaultOperator, int minMatch, ZuliaParser parser1) throws Exception {
Expand All @@ -67,8 +66,10 @@ public void basicTest() throws Exception {

Assertions.assertEquals(q, q2);

oldParser.setSplitOnWhitespace(true);
q = parse("Lung Cancer", List.of("field1", "field2"), Operator.OR, 0, oldParser);
q2 = parse("Lung Cancer", List.of("field1", "field2"), Operator.OR, 0, newParser);
oldParser.setSplitOnWhitespace(false);

Assertions.assertEquals(q, q2);

Expand Down

0 comments on commit a799bb2

Please sign in to comment.