Hi Mukesh,

Are you by a chance deleting docs in that loop, using
the same reader as the one used the searcher?
If so, using a separate reader for delete would fix that.

Also see related discussion -
http://www.nabble.com/Iterating-hits-tf1129306.html#a2955956

Regards,
Doron

Mukesh Bhardwaj <[EMAIL PROTECTED]> wrote on 24/01/2007 06:38:05:

> Hi,
>
>   I'm getting exception while retrieving 100th element id in hits.my
> sample code is given below:
>   for(int i=0;<hits.length();i++)
>      {
>       docID = hits.id(i);
>        --   --  --
>   }
>
>   Here my hits.length() is much greater than 100.The exception that
> I got is as follow:
>   STACKTRACE: java.lang.ArrayIndexOutOfBoundsException: 100 &gt;= 100
>               at java.util.Vector.elementAt(Vector.java:431)
>               at org.apache.lucene.search.Hits.hitDoc(Hits.java:141)
>               at org.apache.lucene.search.Hits.id(Hits.java:116)
>
>   I'm using StandardAnalyzer for indexing and searching.If any one
> has any idea about the same pls let me know.
>
>   Thanks
>   --Mukesh


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to