lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r802424 - in /lucene/solr/trunk/src: java/org/apache/solr/handler/ java/org/apache/solr/handler/admin/ java/org/apache/solr/highlight/ java/org/apache/solr/schema/ java/org/apache/solr/search/ java/org/apache/solr/util/ test/org/apache/solr...
Date Sat, 08 Aug 2009 17:20:43 GMT
Author: yonik
Date: Sat Aug  8 17:20:43 2009
New Revision: 802424

URL: http://svn.apache.org/viewvc?rev=802424&view=rev
Log:
SOLR-1067: further progress on the problem with null qparser

Modified:
    lucene/solr/trunk/src/java/org/apache/solr/handler/FieldAnalysisRequestHandler.java
    lucene/solr/trunk/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java
    lucene/solr/trunk/src/java/org/apache/solr/highlight/SolrHighlighter.java
    lucene/solr/trunk/src/java/org/apache/solr/schema/IndexSchema.java
    lucene/solr/trunk/src/java/org/apache/solr/search/DisMaxQParser.java
    lucene/solr/trunk/src/java/org/apache/solr/search/LuceneQParserPlugin.java
    lucene/solr/trunk/src/java/org/apache/solr/search/SolrQueryParser.java
    lucene/solr/trunk/src/java/org/apache/solr/util/SolrPluginUtils.java
    lucene/solr/trunk/src/test/org/apache/solr/util/SolrPluginUtilsTest.java

Modified: lucene/solr/trunk/src/java/org/apache/solr/handler/FieldAnalysisRequestHandler.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/handler/FieldAnalysisRequestHandler.java?rev=802424&r1=802423&r2=802424&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/handler/FieldAnalysisRequestHandler.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/handler/FieldAnalysisRequestHandler.java Sat
Aug  8 17:20:43 2009
@@ -143,7 +143,7 @@
       useDefaultSearchField = false;
     }
     if (useDefaultSearchField)  {
-      analysisRequest.addFieldName(req.getSchema().getSolrQueryParser(null).getField());
+      analysisRequest.addFieldName(req.getSchema().getDefaultSearchFieldName());
     }
     analysisRequest.setQuery(solrParams.get(AnalysisParams.QUERY, solrParams.get(CommonParams.Q)));
     analysisRequest.setFieldValue(solrParams.get(AnalysisParams.FIELD_VALUE));

Modified: lucene/solr/trunk/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java?rev=802424&r1=802423&r2=802424&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java Sat Aug
 8 17:20:43 2009
@@ -371,7 +371,7 @@
     finfo.add("fields", fields);
     finfo.add("dynamicFields", dynamicFields);
     finfo.add("uniqueKeyField", uniqueField.getName());
-    finfo.add("defaultSearchField", schema.getSolrQueryParser(null).getField());
+    finfo.add("defaultSearchField", schema.getDefaultSearchFieldName());
     finfo.add("types", types);
     return finfo;
   }

Modified: lucene/solr/trunk/src/java/org/apache/solr/highlight/SolrHighlighter.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/highlight/SolrHighlighter.java?rev=802424&r1=802423&r2=802424&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/highlight/SolrHighlighter.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/highlight/SolrHighlighter.java Sat Aug  8 17:20:43
2009
@@ -73,7 +73,7 @@
     if(emptyArray(fields)) {
       // use default search field if highlight fieldlist not specified.
       if (emptyArray(defaultFields)) {
-        String defaultSearchField = request.getSchema().getSolrQueryParser(null).getField();
+        String defaultSearchField = request.getSchema().getDefaultSearchFieldName();
         fields = null == defaultSearchField ? new String[]{} : new String[]{defaultSearchField};
       }
       else {

Modified: lucene/solr/trunk/src/java/org/apache/solr/schema/IndexSchema.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/schema/IndexSchema.java?rev=802424&r1=802423&r2=802424&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/schema/IndexSchema.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/schema/IndexSchema.java Sat Aug  8 17:20:43
2009
@@ -251,6 +251,7 @@
    * <solrQueryParser> configuration for this IndexSchema.
    *
    * @param defaultField if non-null overrides the schema default
+   * @deprecated
    */
   public SolrQueryParser getSolrQueryParser(String defaultField) {
     SolrQueryParser qp = new SolrQueryParser(this,defaultField);
@@ -262,9 +263,7 @@
   
   /**
    * Name of the default search field specified in the schema file
-   * @deprecated use getSolrQueryParser().getField()
    */
-  @Deprecated
   public String getDefaultSearchFieldName() {
     return defaultSearchFieldName;
   }

Modified: lucene/solr/trunk/src/java/org/apache/solr/search/DisMaxQParser.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/search/DisMaxQParser.java?rev=802424&r1=802423&r2=802424&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/search/DisMaxQParser.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/search/DisMaxQParser.java Sat Aug  8 17:20:43
2009
@@ -207,7 +207,7 @@
   protected SolrPluginUtils.DisjunctionMaxQueryParser getParser(Map<String, Float>
fields, String paramName,
                                                                 SolrParams solrParams, float
tiebreaker) {
     int slop = solrParams.getInt(paramName, 0);
-    SolrPluginUtils.DisjunctionMaxQueryParser parser = new SolrPluginUtils.DisjunctionMaxQueryParser(req.getSchema(),
+    SolrPluginUtils.DisjunctionMaxQueryParser parser = new SolrPluginUtils.DisjunctionMaxQueryParser(this,
             IMPOSSIBLE_FIELD_NAME);
     parser.addAlias(IMPOSSIBLE_FIELD_NAME, tiebreaker, fields);
     parser.setPhraseSlop(slop);

Modified: lucene/solr/trunk/src/java/org/apache/solr/search/LuceneQParserPlugin.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/search/LuceneQParserPlugin.java?rev=802424&r1=802423&r2=802424&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/search/LuceneQParserPlugin.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/search/LuceneQParserPlugin.java Sat Aug  8
17:20:43 2009
@@ -61,7 +61,7 @@
 
     String defaultField = getParam(CommonParams.DF);
     if (defaultField==null) {
-      defaultField = getReq().getSchema().getSolrQueryParser(null).getField();
+      defaultField = getReq().getSchema().getDefaultSearchFieldName();
     }
     lparser = new SolrQueryParser(this, defaultField);
 

Modified: lucene/solr/trunk/src/java/org/apache/solr/search/SolrQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/search/SolrQueryParser.java?rev=802424&r1=802423&r2=802424&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/search/SolrQueryParser.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/search/SolrQueryParser.java Sat Aug  8 17:20:43
2009
@@ -64,7 +64,7 @@
    * 
    * @param schema Used for default search field name if defaultField is null and field information
is used for analysis
    * @param defaultField default field used for unspecified search terms.  if null, the schema
default field is used
-   * @see IndexSchema#getSolrQueryParser(String defaultField)
+   * @see IndexSchema#getDefaultSearchFieldName()
    */
   public SolrQueryParser(IndexSchema schema, String defaultField) {
     super(defaultField == null ? schema.getDefaultSearchFieldName() : defaultField, schema.getQueryAnalyzer());

Modified: lucene/solr/trunk/src/java/org/apache/solr/util/SolrPluginUtils.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/util/SolrPluginUtils.java?rev=802424&r1=802423&r2=802424&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/util/SolrPluginUtils.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/util/SolrPluginUtils.java Sat Aug  8 17:20:43
2009
@@ -523,6 +523,7 @@
    * NOTE: intra-function whitespace is not allowed.
    * </p>
    * @see #parseFieldBoosts
+   * @deprecated
    */
   public static List<Query> parseFuncs(IndexSchema s, String in)
     throws ParseException {
@@ -731,7 +732,11 @@
      * DisjunctionMaxQuery and the tiebreaker to use.
      */
     protected Map<String,Alias> aliases = new HashMap<String,Alias>(3);
-        
+    public DisjunctionMaxQueryParser(QParser qp, String defaultField) {
+      super(qp,defaultField);
+      // don't trust that our parent class won't ever change it's default
+      setDefaultOperator(QueryParser.Operator.OR);
+    }
     public DisjunctionMaxQueryParser(IndexSchema s, String defaultField) {
       super(s,defaultField);
       // don't trust that our parent class won't ever change it's default

Modified: lucene/solr/trunk/src/test/org/apache/solr/util/SolrPluginUtilsTest.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/test/org/apache/solr/util/SolrPluginUtilsTest.java?rev=802424&r1=802423&r2=802424&view=diff
==============================================================================
--- lucene/solr/trunk/src/test/org/apache/solr/util/SolrPluginUtilsTest.java (original)
+++ lucene/solr/trunk/src/test/org/apache/solr/util/SolrPluginUtilsTest.java Sat Aug  8 17:20:43
2009
@@ -133,7 +133,7 @@
     assertTrue(t+" sanity test isn't TermQuery: " + out.getClass(),
                out instanceof TermQuery);
     assertEquals(t+" sanity test is wrong field",
-                 h.getCore().getSchema().getSolrQueryParser(null).getField(),
+                 h.getCore().getSchema().getDefaultSearchFieldName(),
                  ((TermQuery)out).getTerm().field());
 
     t = "subject:XXXXXXXX";



Mime
View raw message