lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "WATHELET Thomas" <TWathe...@europarl.eu.int>
Subject RE: Multisearch
Date Mon, 06 Mar 2006 16:44:02 GMT
Thanks a lot. 

-----Original Message-----
From: Erik Hatcher [mailto:erik@ehatchersolutions.com] 
Sent: 06 March 2006 16:25
To: java-user@lucene.apache.org
Subject: Re: Multisearch

On Mar 6, 2006, at 10:05 AM, WATHELET Thomas wrote:
> I made a multi search into my Lucene index. It's work properly but I
> would like to know if it's possible to know in witch index de document
> belong to.

This just came up the other day as well, and was covered in the  
past.  Here's the thread with the answer:

	<http://www.nabble.com/Determine-the-index-of-a-hit-after-using-

MultiSearcher-t638218.html#a1706027>

And here are the relevant snippets:

        MultiSearcher searcher = (MultiSearcher) context.getAttribute 
("searcher");
        IndexReader[] readers = (IndexReader[]) context.getAttribute 
("readers");

        Hits hits = searcher.search(query);


// later while iterating through Hits...

       int indexIndex = searcher.subSearcher(hits.id(position));


Erik


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




---------------------------------------------------------------------
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