lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan G. Freier" <nfre...@cs.washington.edu>
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.

Nathan

Robert A. Decker wrote:

>I've been looking around the org.apache.lucene.search.* 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)
>
>Results:
>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
>scoring?
>
>
>thanks,
>rob
>
>http://www.robdecker.com/
>http://www.planetside.com/
>
>
>--
>To unsubscribe, e-mail:   <mailto:lucene-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
>



--
To unsubscribe, e-mail:   <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>


Mime
View raw message