Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@apache.org Received: (qmail 88990 invoked from network); 29 Mar 2002 20:53:03 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 29 Mar 2002 20:53:03 -0000 Received: (qmail 6406 invoked by uid 97); 29 Mar 2002 20:53:07 -0000 Delivered-To: qmlist-jakarta-archive-lucene-user@jakarta.apache.org Received: (qmail 6366 invoked by uid 97); 29 Mar 2002 20:53:07 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 6355 invoked from network); 29 Mar 2002 20:53:06 -0000 Message-ID: <3CA4D430.4080403@cs.washington.edu> Date: Fri, 29 Mar 2002 12:53:04 -0800 From: "Nathan G. Freier" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1 X-Accept-Language: en-us MIME-Version: 1.0 To: Lucene Users List Subject: Re: Getting the terms that matched the HitDoc? References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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: >For additional commands, e-mail: > -- To unsubscribe, e-mail: For additional commands, e-mail: