From d675518da418af68645c48a5254d70b081d76c3d Mon Sep 17 00:00:00 2001 From: Mike McCandless Date: Wed, 16 Nov 2016 06:10:25 -0500 Subject: [PATCH] LUCENE-7560: make QueryBuilder.createFieldQuery not final anymore --- lucene/CHANGES.txt | 5 +++++ .../core/src/java/org/apache/lucene/util/QueryBuilder.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt index 4ef348c0f2c..28ec5f0aa2e 100644 --- a/lucene/CHANGES.txt +++ b/lucene/CHANGES.txt @@ -96,6 +96,11 @@ Improvements * LUCENE-7537: Index time sorting now supports multi-valued sorts using selectors (MIN, MAX, etc.) (Jim Ferenczi via Mike McCandless) +* LUCENE-7560: QueryBuilder.createFieldQuery is no longer final, + giving custom query parsers subclassing QueryBuilder more freedom to + control how text is analyzed and converted into a query (Matt Weber + via Mike McCandless) + Other * LUCENE-7546: Fixed references to benchmark wikipedia data and the Jenkins line-docs file diff --git a/lucene/core/src/java/org/apache/lucene/util/QueryBuilder.java b/lucene/core/src/java/org/apache/lucene/util/QueryBuilder.java index 309150e2600..977af5387e6 100644 --- a/lucene/core/src/java/org/apache/lucene/util/QueryBuilder.java +++ b/lucene/core/src/java/org/apache/lucene/util/QueryBuilder.java @@ -196,7 +196,7 @@ public class QueryBuilder { * @param quoted true if phrases should be generated when terms occur at more than one position * @param phraseSlop slop factor for phrase/multiphrase queries */ - protected final Query createFieldQuery(Analyzer analyzer, BooleanClause.Occur operator, String field, String queryText, boolean quoted, int phraseSlop) { + protected Query createFieldQuery(Analyzer analyzer, BooleanClause.Occur operator, String field, String queryText, boolean quoted, int phraseSlop) { assert operator == BooleanClause.Occur.SHOULD || operator == BooleanClause.Occur.MUST; // Use the analyzer to get all the tokens, and then build an appropriate