lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject svn commit: r1723419 - in /lucene/dev/trunk/solr: CHANGES.txt core/src/java/org/apache/solr/update/DirectUpdateHandler2.java
Date Wed, 06 Jan 2016 22:19:49 GMT
Author: shalin
Date: Wed Jan  6 22:19:49 2016
New Revision: 1723419

URL: http://svn.apache.org/viewvc?rev=1723419&view=rev
Log:
SOLR-8498: Improve error message when a large value is stored in an indexed string field

Modified:
    lucene/dev/trunk/solr/CHANGES.txt
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java

Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1723419&r1=1723418&r2=1723419&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Wed Jan  6 22:19:49 2016
@@ -438,6 +438,8 @@ Other Changes
 
 * SOLR-8482: add & use QueryCommand.[gs]etTerminateEarly accessors. (Christine Poerschke)
 
+* SOLR-8498: Improve error message when a large value is stored in an indexed string field.
(shalin)
+
 ==================  5.4.0 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java?rev=1723419&r1=1723418&r2=1723419&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java Wed
Jan  6 22:19:49 2016
@@ -43,6 +43,7 @@ import org.apache.lucene.search.BooleanQ
 import org.apache.lucene.search.MatchAllDocsQuery;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.TermQuery;
+import org.apache.lucene.util.BytesRefHash;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.params.ModifiableSolrParams;
 import org.apache.solr.common.util.NamedList;
@@ -169,6 +170,13 @@ public class DirectUpdateHandler2 extend
       return addDoc0(cmd);
     } catch (SolrException e) {
       throw e;
+    } catch (IllegalArgumentException iae) {
+      throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
+          String.format(Locale.ROOT, "Exception writing document id %s to the index; possible
analysis error: "
+              + iae.getMessage()
+              + (iae.getCause() instanceof BytesRefHash.MaxBytesLengthExceededException ?
+              ". Perhaps the document has an indexed string field (solr.StrField) which is
too large" : ""),
+              cmd.getPrintableId()), iae);
     } catch (RuntimeException t) {
       throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
           String.format(Locale.ROOT, "Exception writing document id %s to the index; possible
analysis error.",



Mime
View raw message