lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan G. Freier" <>
Subject Re: Getting the terms that matched the HitDoc?
Date Fri, 29 Mar 2002 20:53:04 GMT
Hi Rob,

One possibility might be to use the IndexReader's termDocs(Term) method 
and then use the skipTo(int) method on the TermDocs object.  Iterate 
over your document list and then your term list for each document.  Each 
time skipTo puts you at the document you are looking for, you can add 
that term to the document's term list.  This probably isn't the most 
efficient method but it should work.


Robert A. Decker wrote:

>I've been looking around the* code and can't
>seem to find an answer to this.
>I would like to present the terms that matched for each document in the
>Hits. For example, to the user it would look like:
>Search Phrase: double blind study found injections
>Search Terms: (doubl blind studi found inject)
>Doc1 doubl blind studi found inject
>Doc2 doubl blind studi found inject
>Doc3 doubl blind studi inject
>Doc4 studi inject
>Is there a way to get the search terms that were used in the relevance
>To unsubscribe, e-mail:   <>
>For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message