Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 70273 invoked from network); 4 Aug 2009 17:52:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Aug 2009 17:52:30 -0000 Received: (qmail 66627 invoked by uid 500); 4 Aug 2009 17:52:32 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 66540 invoked by uid 500); 4 Aug 2009 17:52:32 -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 66530 invoked by uid 99); 4 Aug 2009 17:52:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Aug 2009 17:52:32 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [208.97.132.145] (HELO spunkymail-a10.g.dreamhost.com) (208.97.132.145) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Aug 2009 17:52:21 +0000 Received: from [10.0.0.11] (adsl-065-013-152-164.sip.rdu.bellsouth.net [65.13.152.164]) by spunkymail-a10.g.dreamhost.com (Postfix) with ESMTP id 73A0357519 for ; Tue, 4 Aug 2009 10:51:59 -0700 (PDT) Message-Id: <70FA860F-B368-462B-A510-FBA44FB1806D@apache.org> From: Grant Ingersoll To: java-user@lucene.apache.org In-Reply-To: <74f928500908020830h5d3f4d0aw1f1ed2016c67200@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: score from spans Date: Tue, 4 Aug 2009 13:51:58 -0400 References: <74f928500908020830h5d3f4d0aw1f1ed2016c67200@mail.gmail.com> X-Mailer: Apple Mail (2.935.3) X-Virus-Checked: Checked by ClamAV on apache.org A SpanQuery is a Query, so if you do a search for it, you will get scores. However, the mechanism is a bit complicated, b/c actually getting the Spans is separate from doing the query. I agree there could be tighter integration. However, what you could do is use Spans.skipTo to move to the document you are examining in the search results. -Grant On Aug 2, 2009, at 11:30 AM, Eran Sevi wrote: > Hi, > > How can I get the score of a span that is the result of > SpanQuery.getSpans() > ? The score should can be the same for each document, but if it's > unique per > span, it's even better. > > I tried looking for a way to expose this functionality through the > Spans > class but it looks too complicated. > I'm not even sure that by default some score calculation is even > performed > when using span queries. > > I've noticed that some calculations are made using payloads and > BoostingTermQuery but the score result is used internally and can't be > accessed from the Spans results. > I don't want to re-run the query again using a HitCollector and > since the > reader is passed to getSpans, I think it should be possible to do > what I > want. > > Any help on the correct way to expose the span score will be > appreciated. > > Thanks, > Eran. -------------------------- Grant Ingersoll http://www.lucidimagination.com/ Search the Lucene ecosystem (Lucene/Solr/Nutch/Mahout/Tika/Droids) using Solr/Lucene: http://www.lucidimagination.com/search --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org