From 5d0c468fc52503e311c11610a4083970082c0f66 Mon Sep 17 00:00:00 2001 From: Matthew Davis Date: Thu, 5 May 2022 08:27:08 -0400 Subject: [PATCH] fix pipeline order to ensure wildcard searches against search fields are analyzed (ex. lowercased) --- .../processors/ZuliaQueryNodeProcessorPipeline.java | 2 +- .../java/io/zulia/server/search/queryparser/ParserTest.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/zulia-query-parser/src/main/java/io/zulia/server/search/queryparser/processors/ZuliaQueryNodeProcessorPipeline.java b/zulia-query-parser/src/main/java/io/zulia/server/search/queryparser/processors/ZuliaQueryNodeProcessorPipeline.java index a30188d1..04ff7192 100644 --- a/zulia-query-parser/src/main/java/io/zulia/server/search/queryparser/processors/ZuliaQueryNodeProcessorPipeline.java +++ b/zulia-query-parser/src/main/java/io/zulia/server/search/queryparser/processors/ZuliaQueryNodeProcessorPipeline.java @@ -21,9 +21,9 @@ public ZuliaQueryNodeProcessorPipeline(QueryConfigHandler queryConfig) { //zulia - add global min match handler add(new ZuliaGlobalMinMatchProcessor()); - add(new WildcardQueryNodeProcessor()); //zulia - change MultiFieldQueryNodeProcessor to ZuliaMultiFieldQueryNodeProcessor add(new ZuliaMultiFieldQueryNodeProcessor()); + add(new WildcardQueryNodeProcessor()); add(new ZuliaPureWildcardNodeProcessor()); add(new FuzzyQueryNodeProcessor()); add(new RegexpQueryNodeProcessor()); diff --git a/zulia-query-parser/src/test/java/io/zulia/server/search/queryparser/ParserTest.java b/zulia-query-parser/src/test/java/io/zulia/server/search/queryparser/ParserTest.java index e3e1556f..327d33cd 100644 --- a/zulia-query-parser/src/test/java/io/zulia/server/search/queryparser/ParserTest.java +++ b/zulia-query-parser/src/test/java/io/zulia/server/search/queryparser/ParserTest.java @@ -66,6 +66,11 @@ public void basicTest() throws Exception { Assertions.assertEquals(q, q2); + q = parse("Lung* Cancer*", List.of("title", "abstract"), Operator.OR, 0, oldParser); + q2 = parse("Lung* Cancer*", List.of("title", "abstract"), Operator.OR, 0, newParser); + + 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);