Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 75161 invoked from network); 15 Feb 2008 12:49:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Feb 2008 12:49:52 -0000 Received: (qmail 63345 invoked by uid 500); 15 Feb 2008 12:49:40 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 63319 invoked by uid 500); 15 Feb 2008 12:49:40 -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 63308 invoked by uid 99); 15 Feb 2008 12:49:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Feb 2008 04:49:40 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [208.97.132.207] (HELO spunkymail-a1.g.dreamhost.com) (208.97.132.207) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Feb 2008 12:49:07 +0000 Received: from [192.168.0.3] (adsl-074-229-189-244.sip.rmo.bellsouth.net [74.229.189.244]) by spunkymail-a1.g.dreamhost.com (Postfix) with ESMTP id 86C01100091 for ; Fri, 15 Feb 2008 04:49:12 -0800 (PST) Message-Id: <29DE3473-ED90-4431-8BD6-59E1FF57E623@apache.org> From: Grant Ingersoll To: java-user@lucene.apache.org In-Reply-To: <839ba01c0802140044l518d2c5dt39960d3f1a1dffaf@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 v919.2) Subject: Re: How to pass additional information into Similarity.scorePayload(...) Date: Fri, 15 Feb 2008 07:49:11 -0500 References: <839ba01c0802130131x3afecdcdna3825cab69adc3a9@mail.gmail.com> <6929E41F-F5CA-4BFD-ADE4-B75D3EAA75EA@apache.org> <839ba01c0802131711v5754b5fanaefbb2f5a5a4c3fb@mail.gmail.com> <200802140758.06967.paul.elschot@xs4all.nl> <839ba01c0802140044l518d2c5dt39960d3f1a1dffaf@mail.gmail.com> X-Mailer: Apple Mail (2.919.2) X-Virus-Checked: Checked by ClamAV on apache.org On Feb 14, 2008, at 3:44 AM, Cedric Ho wrote: > > Anyway, I know my requirement is a bit strange, so it's ok if I can't > do this in Lucene. I'll settle with using a ThreadLocal to store the > [10/5/2] weighting and retrieve it in the Similarity.scorePayload(...) > function. > I don't think you are still considering this, but I wanted to note that Similarity.scorePayload() is a call back function, just like the other methods on Similarity. The only query that currently makes that callback is the BoostingTermQuery. Essentially, the only queries that can use payloads are those that use position information when scoring, i.e. the SpanQuerys, of which the BoostingTQ is one. The takeaway here, being, you can't retrieve the payload from the Similarity class. You can only get payloads via the TermPositions object. -Grant --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org