You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ds...@apache.org on 2012/03/28 06:35:46 UTC

svn commit: r1306155 - in /lucene/dev/branches/branch_3x/solr: CHANGES.txt core/src/java/org/apache/solr/schema/IndexSchema.java core/src/java/org/apache/solr/search/SolrQueryParser.java example/solr/conf/schema.xml example/solr/conf/solrconfig.xml

Author: dsmiley
Date: Wed Mar 28 04:35:45 2012
New Revision: 1306155

URL: http://svn.apache.org/viewvc?rev=1306155&view=rev
Log:
SOLR-2724 deprecate in schema.xml: defaultSearchField and defaultOperator

Modified:
    lucene/dev/branches/branch_3x/solr/CHANGES.txt
    lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/schema/IndexSchema.java
    lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/SolrQueryParser.java
    lucene/dev/branches/branch_3x/solr/example/solr/conf/schema.xml
    lucene/dev/branches/branch_3x/solr/example/solr/conf/solrconfig.xml

Modified: lucene/dev/branches/branch_3x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/CHANGES.txt?rev=1306155&r1=1306154&r2=1306155&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_3x/solr/CHANGES.txt Wed Mar 28 04:35:45 2012
@@ -53,6 +53,10 @@ Upgrading from Solr 3.5
 * SOLR-3161: Don't use the 'qt' parameter with a leading '/'.  It probably won't work in 4.0
   and it's now limited in 3.6 to SearchHandler subclasses that aren't lazy-loaded.
 
+* SOLR-2724: Specifying <defaultSearchField> and <solrQueryParser defaultOperator="..."/> in
+  schema.xml is now considered deprecated.  Instead you are encouraged to specify these via the "df"
+  and "q.op" parameters in your request handler definition.  (David Smiley)
+
 New Features
 ----------------------
 * SOLR-2020: Add Java client that uses Apache Http Components http client (4.x).

Modified: lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/schema/IndexSchema.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/schema/IndexSchema.java?rev=1306155&r1=1306154&r2=1306155&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/schema/IndexSchema.java (original)
+++ lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/schema/IndexSchema.java Wed Mar 28 04:35:45 2012
@@ -596,7 +596,7 @@ public final class IndexSchema {
 
     node = (Node) xpath.evaluate("/schema/defaultSearchField/text()", document, XPathConstants.NODE);
     if (node==null) {
-      log.warn("no default search field specified in schema.");
+      log.debug("no default search field specified in schema.");
     } else {
       defaultSearchFieldName=node.getNodeValue().trim();
       // throw exception if specified, but not found or not indexed
@@ -607,7 +607,7 @@ public final class IndexSchema {
           throw new SolrException( SolrException.ErrorCode.SERVER_ERROR, msg );
         }
       }
-      log.info("default search field is "+defaultSearchFieldName);
+      log.info("default search field in schema is "+defaultSearchFieldName);
     }
 
     node = (Node) xpath.evaluate("/schema/solrQueryParser/@defaultOperator", document, XPathConstants.NODE);

Modified: lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/SolrQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/SolrQueryParser.java?rev=1306155&r1=1306154&r2=1306155&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/SolrQueryParser.java (original)
+++ lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/SolrQueryParser.java Wed Mar 28 04:35:45 2012
@@ -157,7 +157,7 @@ public class SolrQueryParser extends Que
     if (field == null && defaultField == null) {
       throw new SolrException
         (SolrException.ErrorCode.BAD_REQUEST,
-         "no field name specified in query and no defaultSearchField defined in schema.xml");
+         "no field name specified in query and no default specified via 'df' param");
     }
   }
 

Modified: lucene/dev/branches/branch_3x/solr/example/solr/conf/schema.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/example/solr/conf/schema.xml?rev=1306155&r1=1306154&r2=1306155&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/example/solr/conf/schema.xml (original)
+++ lucene/dev/branches/branch_3x/solr/example/solr/conf/schema.xml Wed Mar 28 04:35:45 2012
@@ -990,11 +990,13 @@
    -->
  <uniqueKey>id</uniqueKey>
 
- <!-- field for the QueryParser to use when an explicit fieldname is absent -->
- <defaultSearchField>text</defaultSearchField>
-
- <!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
- <solrQueryParser defaultOperator="OR"/>
+  <!-- field for the QueryParser to use when an explicit fieldname is absent
+ DEPRECATED: specify "df" in your request handler instead.
+ <defaultSearchField>text</defaultSearchField> -->
+
+  <!-- SolrQueryParser configuration: defaultOperator="AND|OR"
+ DEPRECATED: specify "q.op" in your request handler to switch from the default of OR.
+ <solrQueryParser defaultOperator="OR"/> -->
 
   <!-- copyField commands copy one field to another at the time a document
         is added to the index.  It's used either to index the same field differently,

Modified: lucene/dev/branches/branch_3x/solr/example/solr/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/example/solr/conf/solrconfig.xml?rev=1306155&r1=1306154&r2=1306155&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/example/solr/conf/solrconfig.xml (original)
+++ lucene/dev/branches/branch_3x/solr/example/solr/conf/solrconfig.xml Wed Mar 28 04:35:45 2012
@@ -725,6 +725,7 @@
      <lst name="defaults">
        <str name="echoParams">explicit</str>
        <int name="rows">10</int>
+       <str name="df">text</str>
      </lst>
     <!-- In addition to defaults, "appends" params can be specified
          to identify values which should be appended to the list of