Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 45068 invoked from network); 24 Jun 2008 19:30:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Jun 2008 19:30:28 -0000 Received: (qmail 42164 invoked by uid 500); 24 Jun 2008 19:30:23 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 42134 invoked by uid 500); 24 Jun 2008 19:30: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 42122 invoked by uid 99); 24 Jun 2008 19:30:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Jun 2008 12:30:22 -0700 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.83] (HELO spunkymail-a6.g.dreamhost.com) (208.97.132.83) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Jun 2008 19:29:07 +0000 Received: from [192.168.0.3] (adsl-074-229-189-244.sip.rmo.bellsouth.net [74.229.189.244]) by spunkymail-a6.g.dreamhost.com (Postfix) with ESMTP id 22EA1109F2E for ; Tue, 24 Jun 2008 12:29:02 -0700 (PDT) Message-Id: From: Grant Ingersoll To: java-user@lucene.apache.org In-Reply-To: <003001c8d615$ac3e9920$7f00a8c0@wuqi> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v924) Subject: Re: How about adding a new paramer to Similarity.scorePayload( ) ? X-Priority: 3 Date: Tue, 24 Jun 2008 15:29:00 -0400 References: <003001c8d615$ac3e9920$7f00a8c0@wuqi> X-Mailer: Apple Mail (2.924) X-Virus-Checked: Checked by ClamAV on apache.org Not sure, but would a CustomScoreQuery (or an extension of it) work for you? This way, you could try to combine the BoostingTermQuery with a ValueSourceQuery (i.e. FunctionQuery) Another option is to just extend BoostingTermQuery and implement your own scorer that takes into account the field. Of course, that isn't to say your idea is wrong. We could add the method and add a new Payload Query that calls it, or just change it all together. Of course, things may change, too, if and when we want to do things like add payload phrase queries. A patch would be good. Just trying to brainstorm some alternatives that don't involve API changes. On Jun 24, 2008, at 12:16 PM, wuqi wrote: > Hi, > I want to customize a new Similarity class which need to adopt > payload information.The current definition of scorePayload is below: > "public float scorePayload(String fieldName, byte [] payload, int > offset, int length)" > I have a problem when using this function.In case we have two > BoostingTermQuery: > BoostingTermQuery #1: fieldName="Country" and fieldValue= > "America" > BoostingTermQuery #2: fieldName="Country" and fieldValue="China" > and the the information of one payloads looks like this: > payload: {new York,san Jose,Chicago} > of course,query #1 should get a higher payPayload score.But current > interface prevent us from sending fieldValue information to > scorePayload function. So maybe we should add a new interface like > public float scorePayload(String fielName,String value,byte[] > payload,int offset,int length) > and Boosting Query also need to be changed accordingly. > > Thanks > -Qi > > > -------------------------- Grant Ingersoll http://www.lucidimagination.com Lucene Helpful Hints: http://wiki.apache.org/lucene-java/BasicsOfPerformance http://wiki.apache.org/lucene-java/LuceneFAQ --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org