lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Miles Barr <mi...@runtime-collective.com>
Subject Re: Why is Hits.java not Serializable?
Date Wed, 10 Aug 2005 11:28:54 GMT
On Tue, 2005-08-09 at 23:37 -0700, Ali Rouhi wrote:
> I can think of  3 reasons why search methods returning Hits objects
> are not exposed in Searchable:
> 
> 1) Someone forgot to declare Hits Serializable
> 2) There is a fundamental reason the forms of search which return Hits
> objects cannot be called remotely, some non optimal form of search
> will get called on the server(s) and I can't do anything about it. For
> example "void search(Query query, Filter filter, HitCollector
> results)" gets called.
> 3) Under the hood everything takes care of itself. When I call the
> "public Hits search(){...}" on the client, and use the Hits object to
> retrieve the 100 most relevant or top sorting results, a non optimal
> form of search does *not* get called on the server (maybe a form
> returning "TopDocs" is called). In this case I'm worrying
> unnecessarily!?
> 
> My hoped for answers are 3) or at least 1). Or I may be missing
> something and there is another answer.

I think the Hits object is lazy loading. I don't know if that means it
keep a reference to the IndexSearcher/IndexReader to load the data or
not, but it probably does. In which case you need to recreate the
reference when deserializing the object. If you deserialize it in
another JVM or another computer it's not obvious what this reference
should be.

But I could be totally off base here.


-- 
Miles Barr <miles@runtime-collective.com>
Runtime Collective Ltd.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message