From java-user-return-14714-apmail-lucene-java-user-archive=lucene.apache.org@lucene.apache.org Fri Jun 03 09:13:50 2005 Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 21346 invoked from network); 3 Jun 2005 09:13:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 3 Jun 2005 09:13:50 -0000 Received: (qmail 37558 invoked by uid 500); 3 Jun 2005 09:13:45 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 37320 invoked by uid 500); 3 Jun 2005 09:13:44 -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 37307 invoked by uid 99); 3 Jun 2005 09:13:44 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from panacea.is.nl (HELO panacea.is.nl) (213.133.34.195) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 03 Jun 2005 02:13:42 -0700 Received: from hai01.hippo.local ([213.133.51.241]) by panacea.is.nl with Microsoft SMTPSVC(5.0.2195.4905); Fri, 3 Jun 2005 11:12:31 +0200 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 Subject: RE: calculate wi = tfi * IDFi for each document. Date: Fri, 3 Jun 2005 11:13:30 +0200 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: calculate wi = tfi * IDFi for each document. Thread-Index: AcVnqFZ5ja5dcI0CRhGCDFmrhjjv0gAb9Icg From: "Max Pfingsthorn" To: X-OriginalArrivalTime: 03 Jun 2005 09:12:31.0175 (UTC) FILETIME=[5EFA1D70:01C5681C] X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi, when IndexSearcher.search gives you a Hits object back, all results are = already sorted by their score, which is computed internally using the = Similarity. You can access it via Hits.score(n) (see = http://lucene.apache.org/java/docs/api/org/apache/lucene/search/Hits.html= ). This is also shown in the demo in org.apache.lucene.demo.SearchFiles = from SVN. (see = http://svn.apache.org/viewcvs.cgi/lucene/java/trunk/src/demo/org/apache/l= ucene/demo/SearchFiles.java?rev=3D150739&view=3Dmarkup). Hope that helps. max -----Original Message----- From: Andrew Boyd [mailto:andrew.boyd@mindspring.com] Sent: Thursday, June 02, 2005 21:22 To: java-user@lucene.apache.org Subject: RE: calculate wi =3D tfi * IDFi for each document. Ok. So if I get 10 Documents back from a search and I want to get the = top 5 weighted terms for each of the 10 documents what API call should I = use? I'm unable to find the connection between Similarity and a = Document. I know I'm missing the elephant that must be in the middle of the room. = Or maybe it's not there. Is what I'm trying to do do-able? Thanks, Andrew -----Original Message----- From: Max Pfingsthorn Sent: Jun 2, 2005 5:33 AM To: java-user@lucene.apache.org Subject: RE: calculate wi =3D tfi * IDFi for each document. Hi, DefaultSimilarity uses exactly this weighting scheme. Makes sense since = it's a pretty standard relevance measure... Bye! max -----Original Message----- From: Andrew Boyd [mailto:andrew.boyd@mindspring.com] Sent: Thursday, June 02, 2005 11:39 To: java-user@lucene.apache.org Subject: calculate wi =3D tfi * IDFi for each document. If I have search results how can I calculate, using lucene's API, wi = =3D tfi * IDFi for each document. wi =3D term weight tfi =3D term frequency in a document IDFi =3D inverse document frequency =3D log(D/dfi) dfi =3D document frequency or number of documents containing term i D =3D number of documents in my search result Thanks, Andrew --------------------------------------------------------------------- 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 --------------------------------------------------------------------- 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