Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 81317 invoked from network); 2 Aug 2007 07:23:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Aug 2007 07:23:34 -0000 Received: (qmail 78429 invoked by uid 500); 2 Aug 2007 07:23:23 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 78395 invoked by uid 500); 2 Aug 2007 07:23:23 -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 78344 invoked by uid 99); 2 Aug 2007 07:23:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Aug 2007 00:23:22 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [194.109.24.33] (HELO smtp-vbr13.xs4all.nl) (194.109.24.33) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Aug 2007 07:22:54 +0000 Received: from k8l.lan (porta.xs4all.nl [80.127.24.69]) by smtp-vbr13.xs4all.nl (8.13.8/8.13.8) with ESMTP id l727MusQ021916 for ; Thu, 2 Aug 2007 09:22:56 +0200 (CEST) (envelope-from paul.elschot@xs4all.nl) From: Paul Elschot To: java-user@lucene.apache.org Subject: Re: Can I do boosting based on term postions? Date: Thu, 2 Aug 2007 09:22:55 +0200 User-Agent: KMail/1.8.2 References: <839ba01c0707312113p278da04bg636e2bfa853e6ff4@mail.gmail.com> <839ba01c0708011907v643faebbv57127e843700abf9@mail.gmail.com> In-Reply-To: <839ba01c0708011907v643faebbv57127e843700abf9@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200708020922.55296.paul.elschot@xs4all.nl> X-Virus-Scanned: by XS4ALL Virus Scanner X-Virus-Checked: Checked by ClamAV on apache.org Cedric, SpanFirstQuery could be a solution without payloads. You may want to give it your own Similarity.sloppyFreq() . Regards, Paul Elschot On Thursday 02 August 2007 04:07, Cedric Ho wrote: > Thanks for the quick response =) > > On 8/1/07, Shailendra Sharma wrote: > > Yes, it is easily doable through "Payload" facility. During indexing process > > (mainly tokenization), you need to push this extra information in each > > token. And then you can use BoostingTermQuery for using Payload value to > > include Payload in the score. You also need to implement Similarity for this > > (mainly scorePayload method). > > If I store, say a custom boost factor as Payload, does it means that I > will store one more byte per term per document in the index file? So > the index file would be much larger? > > > > > Other way can be to extend SpanTermQuery, this already calculates the > > position of match. You just need to do something to use this position value > > in the score calculation. > > I see that SpanTermQuery takes a TermPositions from the indexReader > and I can get the term position from there. However I am not sure how > to incorporate it into the score calculation. Would you mind give a > little more detail on this? > > > > > One possible advantage of SpanTermQuery approach is that you can play > > around, without re-creating indices everytime. > > > > Thanks, > > Shailendra Sharma, > > CTO, Ver se' Innovation Pvt. Ltd. > > Bangalore, India > > > > On 8/1/07, Cedric Ho wrote: > > > > > > Hi all, > > > > > > I was wondering if it is possible to do boosting by search terms' > > > position in the document. > > > > > > for example: > > > search terms appear in the first 100 words, or first 10% words, or in > > > first two paragraphs would be given higher score. > > > > > > Is it achievable through using the new Payload function in lucene 2.2? > > > Or are there any easier ways to achieve these ? > > > > > > > > > Regards, > > > Cedric > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > > > For additional commands, e-mail: java-user-help@lucene.apache.org > > > > > > > > > > Thanks, > Cedric > > --------------------------------------------------------------------- > 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