You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Chris Hostetter <ho...@fucit.org> on 2008/03/30 08:28:23 UTC
CheckIndex: pos -1 is out of bounds
Hey guys, a Solr user just encountered an interesting situation...
...due to a naive "LengthFilter", an Analyzer is produce a TokenStream
where the first Token has a positionIncrement of "0" which seems to
produce this error from CheckIndex...
WARNING: would remove reference to this segment (-fix was not
specified); full exception:
java.lang.RuntimeException: term features:usa: doc 0: pos -1 is out of
bounds
at org.apache.lucene.index.CheckIndex.check(CheckIndex.java:205)
at org.apache.lucene.index.CheckIndex.main(CheckIndex.java:362)
...but as far as i can tell, the index is still usable.
Questions are:
1) is CheckIndex over paranoid?
2) shouldn't IndexWriter have protected against this if it is incorrect?
-Hoss
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: CheckIndex: pos -1 is out of bounds
Posted by Michael McCandless <lu...@mikemccandless.com>.
Interesting!
I would be inclined to allow this, and fix CheckIndex's paranoia. As
far as I can tell, Lucene itself does not mind if the position is -1
(at least PhraseQuery, SpanTermQuery happily find that Term at
position -1), although we do prevent setting positionIncrement to a
negative number in Token.java so you can't get less than -1. Does
anyone know of actual cases where Lucene would choke on this?
Mike
Chris Hostetter wrote:
>
> : Hey guys, a Solr user just encountered an interesting situation...
>
> sorry, i forgot to paste the refrence...
>
> http://www.nabble.com/WordDelimiterFilter%2BLenghtFilter-results-in-
> termPosition%3D%3D-1-to16306788.html
>
>
>
> -Hoss
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: CheckIndex: pos -1 is out of bounds
Posted by Chris Hostetter <ho...@fucit.org>.
: Hey guys, a Solr user just encountered an interesting situation...
sorry, i forgot to paste the refrence...
http://www.nabble.com/WordDelimiterFilter%2BLenghtFilter-results-in-termPosition%3D%3D-1-to16306788.html
-Hoss
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org