lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hoss...@apache.org
Subject svn commit: r884393 - in /lucene/solr/trunk: ./ src/java/org/apache/solr/handler/component/ src/test/test-files/solr/conf/
Date Thu, 26 Nov 2009 03:20:24 GMT
Author: hossman
Date: Thu Nov 26 03:20:23 2009
New Revision: 884393

URL: http://svn.apache.org/viewvc?rev=884393&view=rev
Log:
SOLR-1558: QueryElevationComponent will error at init time (with clear message) if the uniqueKey
field is not backed by StrField

Modified:
    lucene/solr/trunk/CHANGES.txt
    lucene/solr/trunk/src/java/org/apache/solr/handler/component/QueryElevationComponent.java
    lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-SOLR-749.xml
    lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-altdirectory.xml
    lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-facet-sort.xml
    lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-highlight.xml
    lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-nocache.xml
    lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-termindex.xml
    lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-xinclude.xml

Modified: lucene/solr/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/CHANGES.txt?rev=884393&r1=884392&r2=884393&view=diff
==============================================================================
--- lucene/solr/trunk/CHANGES.txt (original)
+++ lucene/solr/trunk/CHANGES.txt Thu Nov 26 03:20:23 2009
@@ -108,6 +108,12 @@
 
 * SOLR-1570: Log warnings if uniqueKey is multi-valued or not stored (hossman, shalin) 
 
+* SOLR-1558: QueryElevationComponent only works if the uniqueKey field is
+  implemented using StrField.  In previous versions of Solr no warning or
+  error would be generated if you attempted to use QueryElevationComponent,
+  it would just fail in unexpected ways.  This has been changed so that it
+  will fail with a clear error message on initialization. (hossman)
+
 Build
 ----------------------
 

Modified: lucene/solr/trunk/src/java/org/apache/solr/handler/component/QueryElevationComponent.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/handler/component/QueryElevationComponent.java?rev=884393&r1=884392&r2=884393&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/handler/component/QueryElevationComponent.java
(original)
+++ lucene/solr/trunk/src/java/org/apache/solr/handler/component/QueryElevationComponent.java
Thu Nov 26 03:20:23 2009
@@ -51,6 +51,7 @@
 import org.apache.solr.common.util.SimpleOrderedMap;
 import org.apache.solr.core.Config;
 import org.apache.solr.core.SolrCore;
+import org.apache.solr.schema.StrField;
 import org.apache.solr.schema.FieldType;
 import org.apache.solr.schema.SchemaField;
 import org.apache.solr.search.SortSpec;
@@ -152,9 +153,9 @@
     }
 
     SchemaField sf = core.getSchema().getUniqueKeyField();
-    if( sf == null ) {
+    if( sf == null || !(sf.getType() instanceof StrField)) {
       throw new SolrException( SolrException.ErrorCode.SERVER_ERROR, 
-          "QueryElevationComponent requires the schema to have a uniqueKeyField" );
+          "QueryElevationComponent requires the schema to have a uniqueKeyField implemented
using StrField" );
     }
     idField = StringHelper.intern(sf.getName());
     

Modified: lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-SOLR-749.xml
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-SOLR-749.xml?rev=884393&r1=884392&r2=884393&view=diff
==============================================================================
--- lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-SOLR-749.xml (original)
+++ lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-SOLR-749.xml Thu Nov 26 03:20:23
2009
@@ -308,21 +308,6 @@
   	<bool name="httpCaching">false</bool>
   </requestHandler>
 
-  <!-- test elevation -->
-  <searchComponent name="elevate" class="org.apache.solr.handler.component.QueryElevationComponent"
>
-    <str name="queryFieldType">string</str>
-    <str name="config-file">elevate.xml</str>
-  </searchComponent>
-
-  <requestHandler name="/elevate" class="org.apache.solr.handler.component.SearchHandler">
-    <lst name="defaults">
-      <str name="echoParams">explicit</str>
-    </lst>
-    <arr name="last-components">
-      <str>elevate</str>
-    </arr>
-  </requestHandler>
-
   <searchComponent name="spellcheck" class="org.apache.solr.handler.component.SpellCheckComponent">
     <str name="queryAnalyzerFieldType">lowerfilt</str>
 

Modified: lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-altdirectory.xml
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-altdirectory.xml?rev=884393&r1=884392&r2=884393&view=diff
==============================================================================
--- lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-altdirectory.xml (original)
+++ lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-altdirectory.xml Thu Nov 26
03:20:23 2009
@@ -316,21 +316,6 @@
   	<bool name="httpCaching">false</bool>
   </requestHandler>
 
-  <!-- test elevation -->
-  <searchComponent name="elevate" class="org.apache.solr.handler.component.QueryElevationComponent"
>
-    <str name="queryFieldType">string</str>
-    <str name="config-file">elevate.xml</str>
-  </searchComponent>
-
-  <requestHandler name="/elevate" class="org.apache.solr.handler.component.SearchHandler">
-    <lst name="defaults">
-      <str name="echoParams">explicit</str>
-    </lst>
-    <arr name="last-components">
-      <str>elevate</str>
-    </arr>
-  </requestHandler>
-
   <searchComponent name="spellcheck" class="org.apache.solr.handler.component.SpellCheckComponent">
     <str name="queryAnalyzerFieldType">lowerfilt</str>
 

Modified: lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-facet-sort.xml
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-facet-sort.xml?rev=884393&r1=884392&r2=884393&view=diff
==============================================================================
--- lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-facet-sort.xml (original)
+++ lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-facet-sort.xml Thu Nov 26 03:20:23
2009
@@ -311,21 +311,6 @@
   	<bool name="httpCaching">false</bool>
   </requestHandler>
 
-  <!-- test elevation -->
-  <searchComponent name="elevate" class="org.apache.solr.handler.component.QueryElevationComponent"
>
-    <str name="queryFieldType">string</str>
-    <str name="config-file">elevate.xml</str>
-  </searchComponent>
-
-  <requestHandler name="/elevate" class="org.apache.solr.handler.component.SearchHandler">
-    <lst name="defaults">
-      <str name="echoParams">explicit</str>
-    </lst>
-    <arr name="last-components">
-      <str>elevate</str>
-    </arr>
-  </requestHandler>
-
   <searchComponent name="spellcheck" class="org.apache.solr.handler.component.SpellCheckComponent">
     <str name="queryAnalyzerFieldType">lowerfilt</str>
 

Modified: lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-highlight.xml
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-highlight.xml?rev=884393&r1=884392&r2=884393&view=diff
==============================================================================
--- lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-highlight.xml (original)
+++ lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-highlight.xml Thu Nov 26 03:20:23
2009
@@ -302,22 +302,6 @@
   <requestHandler name="/update"     class="solr.XmlUpdateRequestHandler"          />
   <requestHandler name="/update/csv" class="solr.CSVRequestHandler" startup="lazy" />
 
-  <!-- test elevation -->
-  <searchComponent name="elevate" class="org.apache.solr.handler.component.QueryElevationComponent"
>
-    <str name="queryFieldType">string</str>
-    <str name="config-file">elevate.xml</str>
-  </searchComponent>
- 
-  <requestHandler name="/elevate" class="org.apache.solr.handler.component.SearchHandler">
-    <lst name="defaults">
-      <str name="echoParams">explicit</str>
-    </lst>
-    <arr name="last-components">
-      <str>elevate</str>
-    </arr>
-  </requestHandler>
-  
-
   <highlighting class="org.apache.solr.highlight.DummyHighlighter">
    <!-- Configure the standard fragmenter -->
    <fragmenter name="gap" class="org.apache.solr.highlight.GapFragmenter" default="true">

Modified: lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-nocache.xml
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-nocache.xml?rev=884393&r1=884392&r2=884393&view=diff
==============================================================================
--- lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-nocache.xml (original)
+++ lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-nocache.xml Thu Nov 26 03:20:23
2009
@@ -266,22 +266,6 @@
   <requestHandler name="/update"     class="solr.XmlUpdateRequestHandler"          />
   <requestHandler name="/update/csv" class="solr.CSVRequestHandler" startup="lazy" />
 
-  <!-- test elevation -->
-  <searchComponent name="elevate" class="org.apache.solr.handler.component.QueryElevationComponent"
>
-    <str name="queryFieldType">string</str>
-    <str name="config-file">elevate.xml</str>
-  </searchComponent>
- 
-  <requestHandler name="/elevate" class="org.apache.solr.handler.component.SearchHandler">
-    <lst name="defaults">
-      <str name="echoParams">explicit</str>
-    </lst>
-    <arr name="last-components">
-      <str>elevate</str>
-    </arr>
-  </requestHandler>
-  
-
   <highlighting>
    <!-- Configure the standard fragmenter -->
    <fragmenter name="gap" class="org.apache.solr.highlight.GapFragmenter" default="true">

Modified: lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-termindex.xml
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-termindex.xml?rev=884393&r1=884392&r2=884393&view=diff
==============================================================================
--- lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-termindex.xml (original)
+++ lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-termindex.xml Thu Nov 26 03:20:23
2009
@@ -328,21 +328,6 @@
   	<bool name="httpCaching">false</bool>
   </requestHandler>
 
-  <!-- test elevation -->
-  <searchComponent name="elevate" class="org.apache.solr.handler.component.QueryElevationComponent"
>
-    <str name="queryFieldType">string</str>
-    <str name="config-file">elevate.xml</str>
-  </searchComponent>
-
-  <requestHandler name="/elevate" class="org.apache.solr.handler.component.SearchHandler">
-    <lst name="defaults">
-      <str name="echoParams">explicit</str>
-    </lst>
-    <arr name="last-components">
-      <str>elevate</str>
-    </arr>
-  </requestHandler>
-
   <searchComponent name="spellcheck" class="org.apache.solr.handler.component.SpellCheckComponent">
     <str name="queryAnalyzerFieldType">lowerfilt</str>
 

Modified: lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-xinclude.xml
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-xinclude.xml?rev=884393&r1=884392&r2=884393&view=diff
==============================================================================
--- lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-xinclude.xml (original)
+++ lucene/solr/trunk/src/test/test-files/solr/conf/solrconfig-xinclude.xml Thu Nov 26 03:20:23
2009
@@ -305,21 +305,6 @@
   	<bool name="httpCaching">false</bool>
   </requestHandler>
 
-  <!-- test elevation -->
-  <searchComponent name="elevate" class="org.apache.solr.handler.component.QueryElevationComponent"
>
-    <str name="queryFieldType">string</str>
-    <str name="config-file">elevate.xml</str>
-  </searchComponent>
-
-  <requestHandler name="/elevate" class="org.apache.solr.handler.component.SearchHandler">
-    <lst name="defaults">
-      <str name="echoParams">explicit</str>
-    </lst>
-    <arr name="last-components">
-      <str>elevate</str>
-    </arr>
-  </requestHandler>
-
   <searchComponent name="spellcheck" class="org.apache.solr.handler.component.SpellCheckComponent">
     <str name="queryAnalyzerFieldType">lowerfilt</str>
 



Mime
View raw message