Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 5213 invoked from network); 8 Nov 2009 13:47:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Nov 2009 13:47:05 -0000 Received: (qmail 386 invoked by uid 500); 8 Nov 2009 13:47:03 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 306 invoked by uid 500); 8 Nov 2009 13:47:03 -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 296 invoked by uid 99); 8 Nov 2009 13:47:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Nov 2009 13:47:03 +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 (nike.apache.org: domain of simon.willnauer@googlemail.com designates 72.14.220.154 as permitted sender) Received: from [72.14.220.154] (HELO fg-out-1718.google.com) (72.14.220.154) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Nov 2009 13:46:52 +0000 Received: by fg-out-1718.google.com with SMTP id 16so861511fgg.5 for ; Sun, 08 Nov 2009 05:46:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=2DolpU9zfAYTLy/ga6CFndbzP20jEnIubEa5ylUw2dI=; b=wPNdTFrWs2pQOZGMxUX2+tizhJ0B3Igp4ONq0mJFOaU0VcT2YVajhN6DDDV6Avmxbn o4xbgsQw8w3YDGcSZap+z2PrQTw/NAHYoCjcdjyto7pffh3dYl7zCVd3I1T/yrEZjT31 BENnZ6GmwzB7vRv7IlQDWly6vRkgfSXTtmlus= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; b=EVGNL45PKr9Q2d/JZw0p5G/IJm7wLnayB/S04f0pHVpeUmVmPboftCYSGI1rFA7BFu dbDXBU6Tb7SdsoOUUCG8ZD7oCx4O/Q2/kAb6fT7MyPjCSUOm4VSNnG47I3QRGZJOnSjL mDkOkflZ797BpEELVZdrsuSvkccbSk/WeIWS4= MIME-Version: 1.0 Received: by 10.239.160.131 with SMTP id c3mr96663hbd.82.1257687992315; Sun, 08 Nov 2009 05:46:32 -0800 (PST) Reply-To: simon.willnauer@gmail.com In-Reply-To: <8d3740db0911080523sd3755c6o55cf65abb109cf47@mail.gmail.com> References: <8d3740db0911080523sd3755c6o55cf65abb109cf47@mail.gmail.com> Date: Sun, 8 Nov 2009 14:46:32 +0100 Message-ID: Subject: Re: synonym payload boosting From: Simon Willnauer To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary=001485f27c200531970477dc4e69 X-Virus-Checked: Checked by ClamAV on apache.org --001485f27c200531970477dc4e69 Content-Type: text/plain; charset=UTF-8 You might get an answer on the solr list. This is the lucene users list. Simon On Nov 8, 2009 2:24 PM, "David Ginzburg" wrote: Hi, I have a field and a wighted synonym map. I have indexed the synonyms with the weight as payload. my code snippet from my filter *public Token next(final Token reusableToken) throws IOException * * . * * . * * .* * Payload boostPayload;* * * * for (Synonym synonym : syns) {* * * * Token newTok = new Token(nToken.startOffset(), nToken.endOffset(), "SYNONYM");* * newTok.setTermBuffer(synonym.getToken().toCharArray(), 0, synonym.getToken().length());* * // set the position increment to zero* * // this tells lucene the synonym is* * // in the exact same location as the originating word* * newTok.setPositionIncrement(0);* * boostPayload = new Payload(PayloadHelper.encodeFloat(synonym.getWieght()));* * newTok.setPayload(boostPayload);* * * I have put it in the index time analyzer : this is my field definition: * my similarity class is public class BoostingSymilarity extends DefaultSimilarity { public BoostingSymilarity(){ super(); } @Override public float scorePayload(String field, byte [] payload, int offset, int length) { double weight = PayloadHelper.decodeFloat(payload, 0); return (float)weight; } @Override public float coord(int overlap, int maxoverlap) { return 1.0f; } @Override public float idf(int docFreq, int numDocs) { return 1.0f; } @Override public float lengthNorm(String fieldName, int numTerms) { return 1.0f; } @Override public float tf(float freq) { return 1.0f; } } My problem is that scorePayload method does not get called at search time like the other methods in my similarity class. I tested and verified it with break points. What am I doing wrong? I used solr 1.3 and thinking of the payload boos support in solr 1.4. * --001485f27c200531970477dc4e69--