Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 47628 invoked from network); 22 Feb 2006 10:18:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Feb 2006 10:18:58 -0000 Received: (qmail 32996 invoked by uid 500); 22 Feb 2006 10:18:45 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 32969 invoked by uid 500); 22 Feb 2006 10:18:45 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 32957 invoked by uid 99); 22 Feb 2006 10:18:44 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Feb 2006 02:18:44 -0800 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=RCVD_IN_BL_SPAMCOP_NET,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of sogwhitester@gmail.com designates 64.233.166.179 as permitted sender) Received: from [64.233.166.179] (HELO pproxy.gmail.com) (64.233.166.179) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Feb 2006 02:18:44 -0800 Received: by pproxy.gmail.com with SMTP id w49so1710906pyg for ; Wed, 22 Feb 2006 02:18:23 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:from:to:references:subject:date:mime-version:content-type:content-transfer-encoding:x-priority:x-msmail-priority:x-mailer:x-mimeole; b=P7RdZT3uySHntAOry9NTIm8AWCDOt9g27LZAI1RG2yR1EW4/6wYbbPfJKSfGmaUXry4MS6S5XNkfNh3gmauQe8d1Ghd7VRhFJutHovMNMDa2yQLJW2ekEGgF5DyUPD5bqRIBkI1hzh4sayGUhfU6t57Pr2j7tGIAPf7rdWsuiPI= Received: by 10.35.91.10 with SMTP id t10mr323682pyl; Wed, 22 Feb 2006 02:18:23 -0800 (PST) Received: from baihui ( [218.247.170.164]) by mx.gmail.com with ESMTP id k62sm568588pyk.2006.02.22.02.18.22; Wed, 22 Feb 2006 02:18:23 -0800 (PST) Message-ID: <004501c63799$4edb59c0$1f00a8c0@baihui> From: "sog" To: References: <006e01c63769$6c6f6010$1f00a8c0@baihui> <43FBF464.6010201@nuix.com.au> Subject: Re: How can I get a term's frequency? Date: Wed, 22 Feb 2006 18:18:18 +0800 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="gb2312"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.3790.1830 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N en, I describe my question more clearly: I search with a group of query terms, I can get a document from the search result: Query(term1, term2, term3)-->search index-->Hits(doc1, doc2, doc3, ......) I wanna get term1's frequency in doc1 ? Hits(docs1((term1,freq),(term2,freq),(term3,freq)), docs2((term1,freq),(term2,freq),(term3,freq)),......) I think the tf value is caculated in the index procedure. can I get the tf(term frequency) value of term1 directly? I can do it in this way: QueryTermVector vector= new QueryTermVector(Document.getValues(field)); freq = result.getTermFrequencies(); but I think this is a very low efficient way. Anyone can help me ? thx sog ----- Original Message ----- From: "Daniel Noll" To: Sent: Wednesday, February 22, 2006 1:19 PM Subject: Re: How can I get a term's frequency? > sog wrote: >> >> I search the index with a group of terms. I want to get every term's >> frequency in each document of the search result. > > Are you looking for this? > > TermFreqVector vector = IndexReader.getTermFreqVector(docNum, "field"); > > That gives you the frequency of every term, but you can just look up the > ones you're interested in. > > Daniel > > > -- > Daniel Noll > > Nuix Australia Pty Ltd > Suite 79, 89 Jones St, Ultimo NSW 2007, Australia > Phone: (02) 9280 0699 > Fax: (02) 9212 6902 > > This message is intended only for the named recipient. If you are not > the intended recipient you are notified that disclosing, copying, > distributing or taking any action in reliance on the contents of this > message or attachment is strictly prohibited. > > --------------------------------------------------------------------- > 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