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 Cocula Remi <rc...@sopragroup.com> on 2004/07/02 16:19:39 UTC
Question about remote searching
Hi,
I am trying to do remote searching via RMI.
In a first step I wrote my own remote search method that should return results as an object of type Hits.
But it does not work as the Hit class is not Serializable.
Then I took a look at the RemoteSearchable class and realized that it implements search using the low level API (ie: public void search(Query query, Filter filter, HitCollector results)).
Elsewhere in Lucene source code I read that using the high level API (those how deals with Hits) is much more efficient.
Question : would it be possible to make the Hit class Serializable so it could be used through RMI mechanisms ?
Re: Question about remote searching
Posted by James Dunn <ja...@yahoo.com>.
You could wrap your RemoteSearchable in a
MultiSearcher and then search against that to get your
Hits object:
/Get a handle on the remote searchable
Searchable remoteSearchable = (Searchable)
Naming.lookup(serverName);
//Create an array of searchables, for use with
MultiSearcher
Searchable[] searchables = new Searchable[1];
searchables[0] = remoteSearchable;
//Create the searcher
MultiSearcher searcher = new
MultiSearcher(searchables);
//Build query
Query q = .....;
Hits hits = searcher.search(q);
--- Cocula Remi <rc...@sopragroup.com> wrote:
> Hi,
>
> I am trying to do remote searching via RMI.
> In a first step I wrote my own remote search method
> that should return results as an object of type
> Hits.
> But it does not work as the Hit class is not
> Serializable.
> Then I took a look at the RemoteSearchable class and
> realized that it implements search using the low
> level API (ie: public void search(Query query,
> Filter filter, HitCollector results)).
>
> Elsewhere in Lucene source code I read that using
> the high level API (those how deals with Hits) is
> much more efficient.
>
> Question : would it be possible to make the Hit
> class Serializable so it could be used through RMI
> mechanisms ?
>
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org