Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 54842 invoked from network); 9 Aug 2009 09:11:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Aug 2009 09:11:00 -0000 Received: (qmail 96357 invoked by uid 500); 9 Aug 2009 09:11:05 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 96279 invoked by uid 500); 9 Aug 2009 09:11:05 -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 96269 invoked by uid 99); 9 Aug 2009 09:11:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Aug 2009 09:11:05 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of eransevi@gmail.com designates 209.85.219.226 as permitted sender) Received: from [209.85.219.226] (HELO mail-ew0-f226.google.com) (209.85.219.226) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Aug 2009 09:10:56 +0000 Received: by ewy26 with SMTP id 26so2596066ewy.5 for ; Sun, 09 Aug 2009 02:10:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Qr5+fVMwQSkET+FH4h/SPCzFddj6BOTrROHiVCISJco=; b=Rdgi3zeuTihIbIxqo3q2MD2e7wmLCzoJ0ZOwA0bOZ+4HpJp9qOjUDfqvUxxR7eUO+p bjZcMfRT2LTnLpzTwNcOb9w4+tLIZ7UmE1uQQUm+nw92E0Zk7EpukzgHBewqy3kRQMlC MGS5R6/79UpkTFSYXt+JA+3+TCeTsefZu7Czc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=xUT2eI7iPwoplqF9tnR8SGGv6FT1G4XpwhMtZi/SDnpTrXst1AtfjHfgbq97a2AhWE 9eGrSIe7BFYAlEVXsV8MfpMuUOImFrVsXjXbV7XuJNwlIZn1X0l7bY3IxhbCabuPT9rJ LlQuEPrBYvg5a8lDjuQeAPt7em0QKOAlAM5A4= MIME-Version: 1.0 Received: by 10.210.81.3 with SMTP id e3mr1622086ebb.18.1249809034924; Sun, 09 Aug 2009 02:10:34 -0700 (PDT) In-Reply-To: <70FA860F-B368-462B-A510-FBA44FB1806D@apache.org> References: <74f928500908020830h5d3f4d0aw1f1ed2016c67200@mail.gmail.com> <70FA860F-B368-462B-A510-FBA44FB1806D@apache.org> Date: Sun, 9 Aug 2009 12:10:34 +0300 Message-ID: <74f928500908090210x1da86971ibad538f6fba97227@mail.gmail.com> Subject: Re: score from spans From: Eran Sevi To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary=0015174c15f09052ed0470b1d7fe X-Virus-Checked: Checked by ClamAV on apache.org --0015174c15f09052ed0470b1d7fe Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Thanks for the answer. I tried to further understand the weight and score mechanism when running a span query search. I noticed that indeed the SpanScorer and SpanWeight are being called and some score is returned but it seems to me that these basic implementations are more appropriate for the basic SpanTermQuery. For the other types of span queries, the inner queries scores and weights are not taken into account - for example if I run a simple SpanOrQuery and boost one of it's child SpanTermQuery, the boost is not taken into account. It seems to me that some recursive calculation is required in order to take into account all the weights and scores of the span's sub queries. I'm trying to come up with a correct implementation for SpanOrQuery, SpanNearQuery, SpanNotQuery based on similiar calculations of BooleanQuery. Do you have a better idea on how to achieve the correct scoring? the score calculations are quite complex for each case of span queries so any help is appreciated. Thanks, Eran. On Tue, Aug 4, 2009 at 8:51 PM, Grant Ingersoll wrote: > 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 > > --0015174c15f09052ed0470b1d7fe--