Wouldn't it make sense to have a Hit know where he came from
such as hit.getIndex() instead of having to invoke subSearcher or subDoc?

Just a thought

Erik Hatcher wrote:
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to