Re: IOException when calling hits.doc(int)

2006-09-13 Thread Huinan
I see. This is what I was curious about. Thanks! On 9/14/06, Andrzej Bialecki <[EMAIL PROTECTED]> wrote: Huinan wrote: > Thanks, Ronnie. But why it works in some cases (when there is a small > number > of documents inside the index) ? The Hits class retrieves the first 50 results, and caches t

Re: IOException when calling hits.doc(int)

2006-09-13 Thread Andrzej Bialecki
Huinan wrote: Thanks, Ronnie. But why it works in some cases (when there is a small number of documents inside the index) ? The Hits class retrieves the first 50 results, and caches them. -- Best regards, Andrzej Bialecki <>< ___. ___ ___ ___ _ _ __ [__ |

Re: IOException when calling hits.doc(int)

2006-09-13 Thread Huinan
I agree. Thanks. On 9/13/06, Ronnie Kolehmainen <[EMAIL PROTECTED]> wrote: This might be related to filesystem, internal lucene buffering/caching, or practically anything that an implementor does not need to have knowledge of. The only thing that you, the implementor, *do* need to know is th

Re: IOException when calling hits.doc(int)

2006-09-13 Thread Ronnie Kolehmainen
This might be related to filesystem, internal lucene buffering/caching, or practically anything that an implementor does not need to have knowledge of. The only thing that you, the implementor, *do* need to know is that you should *not* access a Hits object after the searcher is closed ;) /R

Re: IOException when calling hits.doc(int)

2006-09-13 Thread Huinan
Thanks, Ronnie. But why it works in some cases (when there is a small number of documents inside the index) ? On 9/13/06, Ronnie Kolehmainen <[EMAIL PROTECTED]> wrote: Do not close the searcher until you are done with the Hits object. See the javadocs for Searchable.close() http://lucene.apa

Re: IOException when calling hits.doc(int)

2006-09-13 Thread Ronnie Kolehmainen
Do not close the searcher until you are done with the Hits object. See the javadocs for Searchable.close() http://lucene.apache.org/java/docs/api/org/apache/lucene/search/Searchable.html#close() /Ronnie Huinan wrote: Hi, I'm having a weird problem: I created an index using IndexWriter. Then

IOException when calling hits.doc(int)

2006-09-13 Thread Huinan
Hi, I'm having a weird problem: I created an index using IndexWriter. Then I had a piece of code which searches the index, then print out a particular field of the first document of the hits.(See the following code) As simple as that. Hits hits = IndexSearchUtil.getHits(defaultIndexLocat