You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Peter Wolanin (JIRA)" <ji...@apache.org> on 2009/09/01 17:06:32 UTC

[jira] Created: (SOLR-1400) Document with empty or white-space only string causes exception with TrimFilter

Document with empty or white-space only string causes exception with TrimFilter
-------------------------------------------------------------------------------

                 Key: SOLR-1400
                 URL: https://issues.apache.org/jira/browse/SOLR-1400
             Project: Solr
          Issue Type: Bug
          Components: update
    Affects Versions: 1.4
            Reporter: Peter Wolanin


Observed with Solr trunk.  Posting any empty or whitespace-only string to a field using the {code}<filter class="solr.TrimFilterFactory" />{code}

Causes a java exception:
{code}
Sep 1, 2009 4:58:09 PM org.apache.solr.common.SolrException log
SEVERE: java.lang.ArrayIndexOutOfBoundsException: -1
	at org.apache.solr.analysis.TrimFilter.incrementToken(TrimFilter.java:63)
	at org.apache.solr.analysis.PatternReplaceFilter.incrementToken(PatternReplaceFilter.java:74)
	at org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:138)
	at org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:244)
	at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:772)
	at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:755)
	at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:2611)
	at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:2583)
	at org.apache.solr.update.DirectUpdateHandler2.addDoc(DirectUpdateHandler2.java:241)
	at org.apache.solr.update.processor.RunUpdateProcessor.processAdd(RunUpdateProcessorFactory.java:61)
	at org.apache.solr.handler.XMLLoader.processUpdate(XMLLoader.java:140)
	at org.apache.solr.handler.XMLLoader.load(XMLLoader.java:69)
	at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:54)
	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
	at org.apache.solr.core.SolrCore.execute(SolrCore.java:1299)
	at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:338)
	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:241)
{code}

Trim of an empty or WS-only string should not fail.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-1400) Document with empty or white-space only string causes exception with TrimFilter

Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12751771#action_12751771 ] 

Yonik Seeley commented on SOLR-1400:
------------------------------------

+1
Although the logic could probably be simplified such that a zero-length test wouldn't even be needed, this is the simplest fix.

> Document with empty or white-space only string causes exception with TrimFilter
> -------------------------------------------------------------------------------
>
>                 Key: SOLR-1400
>                 URL: https://issues.apache.org/jira/browse/SOLR-1400
>             Project: Solr
>          Issue Type: Bug
>          Components: update
>    Affects Versions: 1.4
>            Reporter: Peter Wolanin
>            Assignee: Grant Ingersoll
>             Fix For: 1.4
>
>         Attachments: SOLR-1400.patch, trim-example.xml
>
>
> Observed with Solr trunk.  Posting any empty or whitespace-only string to a field using the {code}<filter class="solr.TrimFilterFactory" />{code}
> Causes a java exception:
> {code}
> Sep 1, 2009 4:58:09 PM org.apache.solr.common.SolrException log
> SEVERE: java.lang.ArrayIndexOutOfBoundsException: -1
> 	at org.apache.solr.analysis.TrimFilter.incrementToken(TrimFilter.java:63)
> 	at org.apache.solr.analysis.PatternReplaceFilter.incrementToken(PatternReplaceFilter.java:74)
> 	at org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:138)
> 	at org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:244)
> 	at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:772)
> 	at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:755)
> 	at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:2611)
> 	at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:2583)
> 	at org.apache.solr.update.DirectUpdateHandler2.addDoc(DirectUpdateHandler2.java:241)
> 	at org.apache.solr.update.processor.RunUpdateProcessor.processAdd(RunUpdateProcessorFactory.java:61)
> 	at org.apache.solr.handler.XMLLoader.processUpdate(XMLLoader.java:140)
> 	at org.apache.solr.handler.XMLLoader.load(XMLLoader.java:69)
> 	at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:54)
> 	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
> 	at org.apache.solr.core.SolrCore.execute(SolrCore.java:1299)
> 	at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:338)
> 	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:241)
> {code}
> Trim of an empty or WS-only string should not fail.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SOLR-1400) Document with empty or white-space only string causes exception with TrimFilter

Posted by "Grant Ingersoll (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-1400?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Grant Ingersoll resolved SOLR-1400.
-----------------------------------

    Resolution: Fixed

Committed revision 812494.

> Document with empty or white-space only string causes exception with TrimFilter
> -------------------------------------------------------------------------------
>
>                 Key: SOLR-1400
>                 URL: https://issues.apache.org/jira/browse/SOLR-1400
>             Project: Solr
>          Issue Type: Bug
>          Components: update
>    Affects Versions: 1.4
>            Reporter: Peter Wolanin
>            Assignee: Grant Ingersoll
>             Fix For: 1.4
>
>         Attachments: SOLR-1400.patch, trim-example.xml
>
>
> Observed with Solr trunk.  Posting any empty or whitespace-only string to a field using the {code}<filter class="solr.TrimFilterFactory" />{code}
> Causes a java exception:
> {code}
> Sep 1, 2009 4:58:09 PM org.apache.solr.common.SolrException log
> SEVERE: java.lang.ArrayIndexOutOfBoundsException: -1
> 	at org.apache.solr.analysis.TrimFilter.incrementToken(TrimFilter.java:63)
> 	at org.apache.solr.analysis.PatternReplaceFilter.incrementToken(PatternReplaceFilter.java:74)
> 	at org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:138)
> 	at org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:244)
> 	at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:772)
> 	at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:755)
> 	at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:2611)
> 	at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:2583)
> 	at org.apache.solr.update.DirectUpdateHandler2.addDoc(DirectUpdateHandler2.java:241)
> 	at org.apache.solr.update.processor.RunUpdateProcessor.processAdd(RunUpdateProcessorFactory.java:61)
> 	at org.apache.solr.handler.XMLLoader.processUpdate(XMLLoader.java:140)
> 	at org.apache.solr.handler.XMLLoader.load(XMLLoader.java:69)
> 	at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:54)
> 	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
> 	at org.apache.solr.core.SolrCore.execute(SolrCore.java:1299)
> 	at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:338)
> 	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:241)
> {code}
> Trim of an empty or WS-only string should not fail.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-1400) Document with empty or white-space only string causes exception with TrimFilter

Posted by "Peter Wolanin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12752468#action_12752468 ] 

Peter Wolanin commented on SOLR-1400:
-------------------------------------


these lines seems to vary as to whether there is WS between "char" and the []

{code}
@@ -29,29 +30,48 @@
 public class TestTrimFilter extends BaseTokenTestCase {
   
   public void testTrim() throws Exception {
+    char[] a = " a ".toCharArray();
+    char [] b = "b   ".toCharArray();
+    char [] ccc = "cCc".toCharArray();
+    char[] whitespace = "   ".toCharArray();
+    char[] empty = "".toCharArray();
{code}

> Document with empty or white-space only string causes exception with TrimFilter
> -------------------------------------------------------------------------------
>
>                 Key: SOLR-1400
>                 URL: https://issues.apache.org/jira/browse/SOLR-1400
>             Project: Solr
>          Issue Type: Bug
>          Components: update
>    Affects Versions: 1.4
>            Reporter: Peter Wolanin
>            Assignee: Grant Ingersoll
>             Fix For: 1.4
>
>         Attachments: SOLR-1400.patch, trim-example.xml
>
>
> Observed with Solr trunk.  Posting any empty or whitespace-only string to a field using the {code}<filter class="solr.TrimFilterFactory" />{code}
> Causes a java exception:
> {code}
> Sep 1, 2009 4:58:09 PM org.apache.solr.common.SolrException log
> SEVERE: java.lang.ArrayIndexOutOfBoundsException: -1
> 	at org.apache.solr.analysis.TrimFilter.incrementToken(TrimFilter.java:63)
> 	at org.apache.solr.analysis.PatternReplaceFilter.incrementToken(PatternReplaceFilter.java:74)
> 	at org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:138)
> 	at org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:244)
> 	at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:772)
> 	at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:755)
> 	at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:2611)
> 	at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:2583)
> 	at org.apache.solr.update.DirectUpdateHandler2.addDoc(DirectUpdateHandler2.java:241)
> 	at org.apache.solr.update.processor.RunUpdateProcessor.processAdd(RunUpdateProcessorFactory.java:61)
> 	at org.apache.solr.handler.XMLLoader.processUpdate(XMLLoader.java:140)
> 	at org.apache.solr.handler.XMLLoader.load(XMLLoader.java:69)
> 	at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:54)
> 	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
> 	at org.apache.solr.core.SolrCore.execute(SolrCore.java:1299)
> 	at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:338)
> 	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:241)
> {code}
> Trim of an empty or WS-only string should not fail.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-1400) Document with empty or white-space only string causes exception with TrimFilter

Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-1400?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yonik Seeley updated SOLR-1400:
-------------------------------

    Fix Version/s: 1.4

> Document with empty or white-space only string causes exception with TrimFilter
> -------------------------------------------------------------------------------
>
>                 Key: SOLR-1400
>                 URL: https://issues.apache.org/jira/browse/SOLR-1400
>             Project: Solr
>          Issue Type: Bug
>          Components: update
>    Affects Versions: 1.4
>            Reporter: Peter Wolanin
>             Fix For: 1.4
>
>         Attachments: trim-example.xml
>
>
> Observed with Solr trunk.  Posting any empty or whitespace-only string to a field using the {code}<filter class="solr.TrimFilterFactory" />{code}
> Causes a java exception:
> {code}
> Sep 1, 2009 4:58:09 PM org.apache.solr.common.SolrException log
> SEVERE: java.lang.ArrayIndexOutOfBoundsException: -1
> 	at org.apache.solr.analysis.TrimFilter.incrementToken(TrimFilter.java:63)
> 	at org.apache.solr.analysis.PatternReplaceFilter.incrementToken(PatternReplaceFilter.java:74)
> 	at org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:138)
> 	at org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:244)
> 	at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:772)
> 	at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:755)
> 	at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:2611)
> 	at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:2583)
> 	at org.apache.solr.update.DirectUpdateHandler2.addDoc(DirectUpdateHandler2.java:241)
> 	at org.apache.solr.update.processor.RunUpdateProcessor.processAdd(RunUpdateProcessorFactory.java:61)
> 	at org.apache.solr.handler.XMLLoader.processUpdate(XMLLoader.java:140)
> 	at org.apache.solr.handler.XMLLoader.load(XMLLoader.java:69)
> 	at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:54)
> 	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
> 	at org.apache.solr.core.SolrCore.execute(SolrCore.java:1299)
> 	at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:338)
> 	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:241)
> {code}
> Trim of an empty or WS-only string should not fail.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-1400) Document with empty or white-space only string causes exception with TrimFilter

Posted by "Grant Ingersoll (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12752463#action_12752463 ] 

Grant Ingersoll commented on SOLR-1400:
---------------------------------------

Peter, what is the code style inconsistency?

> Document with empty or white-space only string causes exception with TrimFilter
> -------------------------------------------------------------------------------
>
>                 Key: SOLR-1400
>                 URL: https://issues.apache.org/jira/browse/SOLR-1400
>             Project: Solr
>          Issue Type: Bug
>          Components: update
>    Affects Versions: 1.4
>            Reporter: Peter Wolanin
>            Assignee: Grant Ingersoll
>             Fix For: 1.4
>
>         Attachments: SOLR-1400.patch, trim-example.xml
>
>
> Observed with Solr trunk.  Posting any empty or whitespace-only string to a field using the {code}<filter class="solr.TrimFilterFactory" />{code}
> Causes a java exception:
> {code}
> Sep 1, 2009 4:58:09 PM org.apache.solr.common.SolrException log
> SEVERE: java.lang.ArrayIndexOutOfBoundsException: -1
> 	at org.apache.solr.analysis.TrimFilter.incrementToken(TrimFilter.java:63)
> 	at org.apache.solr.analysis.PatternReplaceFilter.incrementToken(PatternReplaceFilter.java:74)
> 	at org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:138)
> 	at org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:244)
> 	at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:772)
> 	at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:755)
> 	at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:2611)
> 	at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:2583)
> 	at org.apache.solr.update.DirectUpdateHandler2.addDoc(DirectUpdateHandler2.java:241)
> 	at org.apache.solr.update.processor.RunUpdateProcessor.processAdd(RunUpdateProcessorFactory.java:61)
> 	at org.apache.solr.handler.XMLLoader.processUpdate(XMLLoader.java:140)
> 	at org.apache.solr.handler.XMLLoader.load(XMLLoader.java:69)
> 	at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:54)
> 	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
> 	at org.apache.solr.core.SolrCore.execute(SolrCore.java:1299)
> 	at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:338)
> 	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:241)
> {code}
> Trim of an empty or WS-only string should not fail.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-1400) Document with empty or white-space only string causes exception with TrimFilter

Posted by "Peter Wolanin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-1400?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Wolanin updated SOLR-1400:
--------------------------------

    Attachment: trim-example.xml


Post the attached document using the trunk sample schema.xml to reproduce.

> Document with empty or white-space only string causes exception with TrimFilter
> -------------------------------------------------------------------------------
>
>                 Key: SOLR-1400
>                 URL: https://issues.apache.org/jira/browse/SOLR-1400
>             Project: Solr
>          Issue Type: Bug
>          Components: update
>    Affects Versions: 1.4
>            Reporter: Peter Wolanin
>         Attachments: trim-example.xml
>
>
> Observed with Solr trunk.  Posting any empty or whitespace-only string to a field using the {code}<filter class="solr.TrimFilterFactory" />{code}
> Causes a java exception:
> {code}
> Sep 1, 2009 4:58:09 PM org.apache.solr.common.SolrException log
> SEVERE: java.lang.ArrayIndexOutOfBoundsException: -1
> 	at org.apache.solr.analysis.TrimFilter.incrementToken(TrimFilter.java:63)
> 	at org.apache.solr.analysis.PatternReplaceFilter.incrementToken(PatternReplaceFilter.java:74)
> 	at org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:138)
> 	at org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:244)
> 	at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:772)
> 	at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:755)
> 	at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:2611)
> 	at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:2583)
> 	at org.apache.solr.update.DirectUpdateHandler2.addDoc(DirectUpdateHandler2.java:241)
> 	at org.apache.solr.update.processor.RunUpdateProcessor.processAdd(RunUpdateProcessorFactory.java:61)
> 	at org.apache.solr.handler.XMLLoader.processUpdate(XMLLoader.java:140)
> 	at org.apache.solr.handler.XMLLoader.load(XMLLoader.java:69)
> 	at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:54)
> 	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
> 	at org.apache.solr.core.SolrCore.execute(SolrCore.java:1299)
> 	at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:338)
> 	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:241)
> {code}
> Trim of an empty or WS-only string should not fail.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-1400) Document with empty or white-space only string causes exception with TrimFilter

Posted by "Grant Ingersoll (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12751511#action_12751511 ] 

Grant Ingersoll commented on SOLR-1400:
---------------------------------------

Hmm, trimFilter has a test for all whitespace

> Document with empty or white-space only string causes exception with TrimFilter
> -------------------------------------------------------------------------------
>
>                 Key: SOLR-1400
>                 URL: https://issues.apache.org/jira/browse/SOLR-1400
>             Project: Solr
>          Issue Type: Bug
>          Components: update
>    Affects Versions: 1.4
>            Reporter: Peter Wolanin
>            Assignee: Grant Ingersoll
>             Fix For: 1.4
>
>         Attachments: trim-example.xml
>
>
> Observed with Solr trunk.  Posting any empty or whitespace-only string to a field using the {code}<filter class="solr.TrimFilterFactory" />{code}
> Causes a java exception:
> {code}
> Sep 1, 2009 4:58:09 PM org.apache.solr.common.SolrException log
> SEVERE: java.lang.ArrayIndexOutOfBoundsException: -1
> 	at org.apache.solr.analysis.TrimFilter.incrementToken(TrimFilter.java:63)
> 	at org.apache.solr.analysis.PatternReplaceFilter.incrementToken(PatternReplaceFilter.java:74)
> 	at org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:138)
> 	at org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:244)
> 	at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:772)
> 	at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:755)
> 	at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:2611)
> 	at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:2583)
> 	at org.apache.solr.update.DirectUpdateHandler2.addDoc(DirectUpdateHandler2.java:241)
> 	at org.apache.solr.update.processor.RunUpdateProcessor.processAdd(RunUpdateProcessorFactory.java:61)
> 	at org.apache.solr.handler.XMLLoader.processUpdate(XMLLoader.java:140)
> 	at org.apache.solr.handler.XMLLoader.load(XMLLoader.java:69)
> 	at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:54)
> 	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
> 	at org.apache.solr.core.SolrCore.execute(SolrCore.java:1299)
> 	at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:338)
> 	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:241)
> {code}
> Trim of an empty or WS-only string should not fail.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-1400) Document with empty or white-space only string causes exception with TrimFilter

Posted by "Grant Ingersoll (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-1400?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Grant Ingersoll updated SOLR-1400:
----------------------------------

    Attachment: SOLR-1400.patch

Try this out.

> Document with empty or white-space only string causes exception with TrimFilter
> -------------------------------------------------------------------------------
>
>                 Key: SOLR-1400
>                 URL: https://issues.apache.org/jira/browse/SOLR-1400
>             Project: Solr
>          Issue Type: Bug
>          Components: update
>    Affects Versions: 1.4
>            Reporter: Peter Wolanin
>            Assignee: Grant Ingersoll
>             Fix For: 1.4
>
>         Attachments: SOLR-1400.patch, trim-example.xml
>
>
> Observed with Solr trunk.  Posting any empty or whitespace-only string to a field using the {code}<filter class="solr.TrimFilterFactory" />{code}
> Causes a java exception:
> {code}
> Sep 1, 2009 4:58:09 PM org.apache.solr.common.SolrException log
> SEVERE: java.lang.ArrayIndexOutOfBoundsException: -1
> 	at org.apache.solr.analysis.TrimFilter.incrementToken(TrimFilter.java:63)
> 	at org.apache.solr.analysis.PatternReplaceFilter.incrementToken(PatternReplaceFilter.java:74)
> 	at org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:138)
> 	at org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:244)
> 	at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:772)
> 	at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:755)
> 	at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:2611)
> 	at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:2583)
> 	at org.apache.solr.update.DirectUpdateHandler2.addDoc(DirectUpdateHandler2.java:241)
> 	at org.apache.solr.update.processor.RunUpdateProcessor.processAdd(RunUpdateProcessorFactory.java:61)
> 	at org.apache.solr.handler.XMLLoader.processUpdate(XMLLoader.java:140)
> 	at org.apache.solr.handler.XMLLoader.load(XMLLoader.java:69)
> 	at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:54)
> 	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
> 	at org.apache.solr.core.SolrCore.execute(SolrCore.java:1299)
> 	at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:338)
> 	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:241)
> {code}
> Trim of an empty or WS-only string should not fail.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (SOLR-1400) Document with empty or white-space only string causes exception with TrimFilter

Posted by "Grant Ingersoll (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-1400?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Grant Ingersoll reassigned SOLR-1400:
-------------------------------------

    Assignee: Grant Ingersoll

> Document with empty or white-space only string causes exception with TrimFilter
> -------------------------------------------------------------------------------
>
>                 Key: SOLR-1400
>                 URL: https://issues.apache.org/jira/browse/SOLR-1400
>             Project: Solr
>          Issue Type: Bug
>          Components: update
>    Affects Versions: 1.4
>            Reporter: Peter Wolanin
>            Assignee: Grant Ingersoll
>             Fix For: 1.4
>
>         Attachments: trim-example.xml
>
>
> Observed with Solr trunk.  Posting any empty or whitespace-only string to a field using the {code}<filter class="solr.TrimFilterFactory" />{code}
> Causes a java exception:
> {code}
> Sep 1, 2009 4:58:09 PM org.apache.solr.common.SolrException log
> SEVERE: java.lang.ArrayIndexOutOfBoundsException: -1
> 	at org.apache.solr.analysis.TrimFilter.incrementToken(TrimFilter.java:63)
> 	at org.apache.solr.analysis.PatternReplaceFilter.incrementToken(PatternReplaceFilter.java:74)
> 	at org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:138)
> 	at org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:244)
> 	at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:772)
> 	at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:755)
> 	at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:2611)
> 	at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:2583)
> 	at org.apache.solr.update.DirectUpdateHandler2.addDoc(DirectUpdateHandler2.java:241)
> 	at org.apache.solr.update.processor.RunUpdateProcessor.processAdd(RunUpdateProcessorFactory.java:61)
> 	at org.apache.solr.handler.XMLLoader.processUpdate(XMLLoader.java:140)
> 	at org.apache.solr.handler.XMLLoader.load(XMLLoader.java:69)
> 	at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:54)
> 	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
> 	at org.apache.solr.core.SolrCore.execute(SolrCore.java:1299)
> 	at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:338)
> 	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:241)
> {code}
> Trim of an empty or WS-only string should not fail.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-1400) Document with empty or white-space only string causes exception with TrimFilter

Posted by "Peter Wolanin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12752245#action_12752245 ] 

Peter Wolanin commented on SOLR-1400:
-------------------------------------

The patch seems to fix the bug for me, but there seems to be some code style inconsistency in the test code.

> Document with empty or white-space only string causes exception with TrimFilter
> -------------------------------------------------------------------------------
>
>                 Key: SOLR-1400
>                 URL: https://issues.apache.org/jira/browse/SOLR-1400
>             Project: Solr
>          Issue Type: Bug
>          Components: update
>    Affects Versions: 1.4
>            Reporter: Peter Wolanin
>            Assignee: Grant Ingersoll
>             Fix For: 1.4
>
>         Attachments: SOLR-1400.patch, trim-example.xml
>
>
> Observed with Solr trunk.  Posting any empty or whitespace-only string to a field using the {code}<filter class="solr.TrimFilterFactory" />{code}
> Causes a java exception:
> {code}
> Sep 1, 2009 4:58:09 PM org.apache.solr.common.SolrException log
> SEVERE: java.lang.ArrayIndexOutOfBoundsException: -1
> 	at org.apache.solr.analysis.TrimFilter.incrementToken(TrimFilter.java:63)
> 	at org.apache.solr.analysis.PatternReplaceFilter.incrementToken(PatternReplaceFilter.java:74)
> 	at org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:138)
> 	at org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:244)
> 	at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:772)
> 	at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:755)
> 	at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:2611)
> 	at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:2583)
> 	at org.apache.solr.update.DirectUpdateHandler2.addDoc(DirectUpdateHandler2.java:241)
> 	at org.apache.solr.update.processor.RunUpdateProcessor.processAdd(RunUpdateProcessorFactory.java:61)
> 	at org.apache.solr.handler.XMLLoader.processUpdate(XMLLoader.java:140)
> 	at org.apache.solr.handler.XMLLoader.load(XMLLoader.java:69)
> 	at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:54)
> 	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
> 	at org.apache.solr.core.SolrCore.execute(SolrCore.java:1299)
> 	at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:338)
> 	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:241)
> {code}
> Trim of an empty or WS-only string should not fail.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-1400) Document with empty or white-space only string causes exception with TrimFilter

Posted by "Sascha Szott (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12752455#action_12752455 ] 

Sascha Szott commented on SOLR-1400:
------------------------------------

Grant, why couldn't you readd the checks you introduced in revision #643465

{noformat}
Token t = input.next(in);
if (null == t || null == t.termBuffer() || t.termLength() == 0) {
  return t;
}
{noformat}

and adjust them to the changes in the API, which results in

{noformat}
if (termAtt == null || termAtt.termBuffer() == null || termAtt.termLength() == 0) {
  return true;
}
{noformat}

To be honest, I'm not sure which return value suits best  here.

> Document with empty or white-space only string causes exception with TrimFilter
> -------------------------------------------------------------------------------
>
>                 Key: SOLR-1400
>                 URL: https://issues.apache.org/jira/browse/SOLR-1400
>             Project: Solr
>          Issue Type: Bug
>          Components: update
>    Affects Versions: 1.4
>            Reporter: Peter Wolanin
>            Assignee: Grant Ingersoll
>             Fix For: 1.4
>
>         Attachments: SOLR-1400.patch, trim-example.xml
>
>
> Observed with Solr trunk.  Posting any empty or whitespace-only string to a field using the {code}<filter class="solr.TrimFilterFactory" />{code}
> Causes a java exception:
> {code}
> Sep 1, 2009 4:58:09 PM org.apache.solr.common.SolrException log
> SEVERE: java.lang.ArrayIndexOutOfBoundsException: -1
> 	at org.apache.solr.analysis.TrimFilter.incrementToken(TrimFilter.java:63)
> 	at org.apache.solr.analysis.PatternReplaceFilter.incrementToken(PatternReplaceFilter.java:74)
> 	at org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:138)
> 	at org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:244)
> 	at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:772)
> 	at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:755)
> 	at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:2611)
> 	at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:2583)
> 	at org.apache.solr.update.DirectUpdateHandler2.addDoc(DirectUpdateHandler2.java:241)
> 	at org.apache.solr.update.processor.RunUpdateProcessor.processAdd(RunUpdateProcessorFactory.java:61)
> 	at org.apache.solr.handler.XMLLoader.processUpdate(XMLLoader.java:140)
> 	at org.apache.solr.handler.XMLLoader.load(XMLLoader.java:69)
> 	at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:54)
> 	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
> 	at org.apache.solr.core.SolrCore.execute(SolrCore.java:1299)
> 	at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:338)
> 	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:241)
> {code}
> Trim of an empty or WS-only string should not fail.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.