lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cpoersc...@apache.org
Subject svn commit: r1715368 - in /lucene/dev/branches/branch_5x: ./ lucene/ lucene/queryparser/ lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/
Date Fri, 20 Nov 2015 14:18:50 GMT
Author: cpoerschke
Date: Fri Nov 20 14:18:50 2015
New Revision: 1715368

URL: http://svn.apache.org/viewvc?rev=1715368&view=rev
Log:
LUCENE-6893: factor out CorePlusQueriesParser from CorePlusExtensionsParser (merge in revision
1715343 from trunk)

Added:
    lucene/dev/branches/branch_5x/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/CorePlusQueriesParser.java
      - copied, changed from r1715343, lucene/dev/branches/branch_5x/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/CorePlusExtensionsParser.java
Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/lucene/   (props changed)
    lucene/dev/branches/branch_5x/lucene/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/branch_5x/lucene/queryparser/   (props changed)
    lucene/dev/branches/branch_5x/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/CorePlusExtensionsParser.java

Modified: lucene/dev/branches/branch_5x/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/CHANGES.txt?rev=1715368&r1=1715367&r2=1715368&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/CHANGES.txt (original)
+++ lucene/dev/branches/branch_5x/lucene/CHANGES.txt Fri Nov 20 14:18:50 2015
@@ -278,6 +278,9 @@ Other
 * LUCENE-6887: DefaultSimilarity is deprecated, use ClassicSimilarity for equivilent behavior,
   or consider switching to BM25Similarity which will become the new default in Lucene 6.0
(hossman)
 
+* LUCENE-6893: factor out CorePlusQueriesParser from CorePlusExtensionsParser
+  (Christine Poerschke)
+
 Build
 
 * LUCENE-6732: Improve checker for invalid source patterns to also

Modified: lucene/dev/branches/branch_5x/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/CorePlusExtensionsParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/CorePlusExtensionsParser.java?rev=1715368&r1=1715367&r2=1715368&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/CorePlusExtensionsParser.java
(original)
+++ lucene/dev/branches/branch_5x/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/CorePlusExtensionsParser.java
Fri Nov 20 14:18:50 2015
@@ -2,7 +2,8 @@ package org.apache.lucene.queryparser.xm
 
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.queryparser.classic.QueryParser;
-import org.apache.lucene.queryparser.xml.builders.*;
+import org.apache.lucene.queryparser.xml.builders.DuplicateFilterBuilder;
+import org.apache.lucene.queryparser.xml.builders.FuzzyLikeThisQueryBuilder;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -26,7 +27,7 @@ import org.apache.lucene.queryparser.xml
  * Lucene's <code>sandbox</code> and <code>queries</code>
  * modules in addition to core queries.
  */
-public class CorePlusExtensionsParser extends CoreParser {
+public class CorePlusExtensionsParser extends CorePlusQueriesParser {
 
   /**
    * Construct an XML parser that uses a single instance QueryParser for handling
@@ -49,12 +50,7 @@ public class CorePlusExtensionsParser ex
 
   private CorePlusExtensionsParser(String defaultField, Analyzer analyzer, QueryParser parser)
{
     super(defaultField, analyzer, parser);
-    filterFactory.addBuilder("TermsFilter", new TermsFilterBuilder(analyzer));
-    filterFactory.addBuilder("BooleanFilter", new BooleanFilterBuilder(filterFactory));
     filterFactory.addBuilder("DuplicateFilter", new DuplicateFilterBuilder());
-    String fields[] = {"contents"};
-    queryFactory.addBuilder("LikeThisQuery", new LikeThisQueryBuilder(analyzer, fields));
-    queryFactory.addBuilder("BoostingQuery", new BoostingQueryBuilder(queryFactory));
     queryFactory.addBuilder("FuzzyLikeThisQuery", new FuzzyLikeThisQueryBuilder(analyzer));
 
   }

Copied: lucene/dev/branches/branch_5x/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/CorePlusQueriesParser.java
(from r1715343, lucene/dev/branches/branch_5x/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/CorePlusExtensionsParser.java)
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/CorePlusQueriesParser.java?p2=lucene/dev/branches/branch_5x/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/CorePlusQueriesParser.java&p1=lucene/dev/branches/branch_5x/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/CorePlusExtensionsParser.java&r1=1715343&r2=1715368&rev=1715368&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/CorePlusExtensionsParser.java
(original)
+++ lucene/dev/branches/branch_5x/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/CorePlusQueriesParser.java
Fri Nov 20 14:18:50 2015
@@ -2,7 +2,10 @@ package org.apache.lucene.queryparser.xm
 
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.queryparser.classic.QueryParser;
-import org.apache.lucene.queryparser.xml.builders.*;
+import org.apache.lucene.queryparser.xml.builders.TermsFilterBuilder;
+import org.apache.lucene.queryparser.xml.builders.BooleanFilterBuilder;
+import org.apache.lucene.queryparser.xml.builders.LikeThisQueryBuilder;
+import org.apache.lucene.queryparser.xml.builders.BoostingQueryBuilder;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -23,10 +26,9 @@ import org.apache.lucene.queryparser.xml
 
 /**
  * Assembles a QueryBuilder which uses Query objects from
- * Lucene's <code>sandbox</code> and <code>queries</code>
- * modules in addition to core queries.
+ * Lucene's <code>queries</code> module in addition to core queries.
  */
-public class CorePlusExtensionsParser extends CoreParser {
+public class CorePlusQueriesParser extends CoreParser {
 
   /**
    * Construct an XML parser that uses a single instance QueryParser for handling
@@ -34,7 +36,7 @@ public class CorePlusExtensionsParser ex
    *
    * @param parser A QueryParser which will be synchronized on during parse calls.
    */
-  public CorePlusExtensionsParser(Analyzer analyzer, QueryParser parser) {
+  public CorePlusQueriesParser(Analyzer analyzer, QueryParser parser) {
     this(null, analyzer, parser);
   }
 
@@ -43,19 +45,17 @@ public class CorePlusExtensionsParser ex
    *
    * @param defaultField The default field name used by QueryParsers constructed for UserQuery
tags
    */
-  public CorePlusExtensionsParser(String defaultField, Analyzer analyzer) {
+  public CorePlusQueriesParser(String defaultField, Analyzer analyzer) {
     this(defaultField, analyzer, null);
   }
 
-  private CorePlusExtensionsParser(String defaultField, Analyzer analyzer, QueryParser parser)
{
+  protected CorePlusQueriesParser(String defaultField, Analyzer analyzer, QueryParser parser)
{
     super(defaultField, analyzer, parser);
     filterFactory.addBuilder("TermsFilter", new TermsFilterBuilder(analyzer));
     filterFactory.addBuilder("BooleanFilter", new BooleanFilterBuilder(filterFactory));
-    filterFactory.addBuilder("DuplicateFilter", new DuplicateFilterBuilder());
     String fields[] = {"contents"};
     queryFactory.addBuilder("LikeThisQuery", new LikeThisQueryBuilder(analyzer, fields));
     queryFactory.addBuilder("BoostingQuery", new BoostingQueryBuilder(queryFactory));
-    queryFactory.addBuilder("FuzzyLikeThisQuery", new FuzzyLikeThisQueryBuilder(analyzer));
 
   }
 }



Mime
View raw message