You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by MarkWilliams <oi...@gmail.com> on 2006/08/23 16:29:12 UTC
Empty doc objects & "The handle is invalid" IOExceptions
Hi,
I am having a strange problem with Lucene and am wondering if anyone can
help me.
I have Lucene indexing my site ok, but the problem is with queries.
Search is fine with some terms but when searching with certain other terms,
it seems mainly with terms containing spaces, although others have caused
problems, I get the IOException error "The handle is invalid". I have
debuged my app. and for some reason, the hits object is being filled with
mostly null doc objects and some doc objects with field values, however when
trying to loop through the hits object, I get the "The handle is invalid"
error.
Does anyone know why I'm getting so many empty doc objects and how I can go
about fixing the IOException error.
Thanks very much.
Mark
--
View this message in context: http://www.nabble.com/Empty-doc-objects---%22The-handle-is-invalid%22-IOExceptions-tf2152764.html#a5945557
Sent from the Lucene - Java Developer forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
Re: Empty doc objects & "The handle is invalid" IOExceptions
Posted by MarkWilliams <oi...@gmail.com>.
Indeed, this seems to be exactly why. I now close the IndexSearcher after
using the Hits object and all is fine.
Thanks a lot.
Mark
Andrzej Bialecki wrote:
>
> MarkWilliams wrote:
>> Hi,
>>
>> I am having a strange problem with Lucene and am wondering if anyone can
>> help me.
>>
>> I have Lucene indexing my site ok, but the problem is with queries.
>>
>> Search is fine with some terms but when searching with certain other
>> terms,
>> it seems mainly with terms containing spaces, although others have caused
>> problems, I get the IOException error "The handle is invalid". I have
>> debuged my app. and for some reason, the hits object is being filled with
>> mostly null doc objects and some doc objects with field values, however
>> when
>> trying to loop through the hits object, I get the "The handle is invalid"
>> error.
>>
>> Does anyone know why I'm getting so many empty doc objects and how I can
>> go
>> about fixing the IOException error.
>>
>
> This sounds like a symptom of closing IndexReader (or IndexSearcher) too
> early. Your IndexReader/IndexSearcher must be open throughout the life
> of the Hits object - documents are lazy-loaded into Hits only when you
> request them, and behind the scenes Lucene is reading them from the
> IndexReader.
>
> --
> Best regards,
> Andrzej Bialecki <><
> ___. ___ ___ ___ _ _ __________________________________
> [__ || __|__/|__||\/| Information Retrieval, Semantic Web
> ___|||__|| \| || | Embedded Unix, System Integration
> http://www.sigram.com Contact: info at sigram dot com
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/Empty-doc-objects---%22The-handle-is-invalid%22-IOExceptions-tf2152764.html#a5980883
Sent from the Lucene - Java Developer forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
Re: Empty doc objects & "The handle is invalid" IOExceptions
Posted by Andrzej Bialecki <ab...@getopt.org>.
MarkWilliams wrote:
> Hi,
>
> I am having a strange problem with Lucene and am wondering if anyone can
> help me.
>
> I have Lucene indexing my site ok, but the problem is with queries.
>
> Search is fine with some terms but when searching with certain other terms,
> it seems mainly with terms containing spaces, although others have caused
> problems, I get the IOException error "The handle is invalid". I have
> debuged my app. and for some reason, the hits object is being filled with
> mostly null doc objects and some doc objects with field values, however when
> trying to loop through the hits object, I get the "The handle is invalid"
> error.
>
> Does anyone know why I'm getting so many empty doc objects and how I can go
> about fixing the IOException error.
>
This sounds like a symptom of closing IndexReader (or IndexSearcher) too
early. Your IndexReader/IndexSearcher must be open throughout the life
of the Hits object - documents are lazy-loaded into Hits only when you
request them, and behind the scenes Lucene is reading them from the
IndexReader.
--
Best regards,
Andrzej Bialecki <><
___. ___ ___ ___ _ _ __________________________________
[__ || __|__/|__||\/| Information Retrieval, Semantic Web
___|||__|| \| || | Embedded Unix, System Integration
http://www.sigram.com Contact: info at sigram dot com
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org