Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 8143 invoked from network); 8 Nov 2009 13:53:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Nov 2009 13:53:04 -0000 Received: (qmail 6701 invoked by uid 500); 8 Nov 2009 13:53:02 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 6628 invoked by uid 500); 8 Nov 2009 13:53:02 -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 6616 invoked by uid 99); 8 Nov 2009 13:53:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Nov 2009 13:53:02 +0000 X-ASF-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [206.190.49.15] (HELO web52905.mail.re2.yahoo.com) (206.190.49.15) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 08 Nov 2009 13:52:59 +0000 Received: (qmail 43101 invoked by uid 60001); 8 Nov 2009 13:52:38 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1257688358; bh=e2p3AhBngXr0IYqro8lO1Yte9TCGmwvAtbPlsTQb8sQ=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=Ktl3Q7FoFA5EKijw6ratJ9anXml2K0xzQULvy5ThWzpIcFDNWU1hH2HjwbEpHmLBEnIc3agqGmKKggDYWPx9AUFKocae2qVl2AJhS33DRz8JFvQqAzLj5E/E+cvEu7fo0suX8xSNyjNi2i9ZW6I4DCgDburLdBWqCy5JU8Y4tUY= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=PTmGEFRJvRosCKZvSKcH5xX9votVj1EpHsMpmUihXkfM7yJM0mC59j9DF4TWiLRKx2vKWbD/FA7MAKatAEZUH3vxW9eq0K50santK3P7wolA5osh/W2lpV9O9KMiHjoxEv6HZxs7yX0BtS0e97r/lRnVRcb9QCLdnIf0311p4Tg=; Message-ID: <192117.42603.qm@web52905.mail.re2.yahoo.com> X-YMail-OSG: 7cXE4GEVM1k50Nzx_eUSs.JIdkzGMF_hJjWw3NiijyFTW7U6FHdit9KJmYJQRXHnt3pQIpBccqRCNUHlPSF983VdeHga82GsWfSBNWEHpplB6OKV0KiqYNg0lYX1ygFAK3CiJbGcMUaBQp270_iFC.x8AinCUVXNn2elZ9b7y5DGoq.U7XerH25HRwC635FQu16mzF4kRdEbDJjdfTVq8XB3r4.8MXgzZZMwWRwXGlJaOiEp6w0q0DEpR5p.fScE2CTbbbwyNE_sZZ5s6LYv5kuc0omrPV1dpulCaOJoc.1v64BAjkQMdgSzC4hI5c2dYUQuAGcusTCVHEvRbGWjZrpqeWhkTaBLZi727TDZkE408u3LNv280zvrS_A4qqyGoqn2m4s- Received: from [78.168.183.38] by web52905.mail.re2.yahoo.com via HTTP; Sun, 08 Nov 2009 05:52:37 PST X-Mailer: YahooMailClassic/8.1.6 YahooMailWebService/0.7.361.4 Date: Sun, 8 Nov 2009 05:52:37 -0800 (PST) From: AHMET ARSLAN Subject: Re: synonym payload boosting To: java-user@lucene.apache.org In-Reply-To: <8d3740db0911080523sd3755c6o55cf65abb109cf47@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Additionaly you need to modify your queryparser to return BoostingTermQuery= , PayloadTermQuery, PayloadNearQuery etc.=0A=0AWith these types of Queries = scorePayload method invoked.=0A=0AHope this helps.=0A=0A--- On Sun, 11/8/09= , David Ginzburg wrote:=0A=0A> From: David Ginzbu= rg =0A> Subject: synonym payload boosting=0A> To: = java-user@lucene.apache.org=0A> Date: Sunday, November 8, 2009, 3:23 PM=0A>= Hi,=0A> I have a field and a wighted synonym map.=0A> I have indexed the s= ynonyms with the weight as payload.=0A> my code snippet from my filter=0A> = =0A> *public Token next(final Token reusableToken) throws=0A> IOException *= =0A> *=A0 =A0 =A0 =A0 . *=0A> *=A0 =A0 =A0 =A0 . *=0A> *=A0 =A0 =A0 =A0 .*= =0A> =A0 =A0 =A0=A0=A0* Payload boostPayload;*=0A> *=0A> *=0A> *=A0 =A0 =A0= =A0 for (Synonym synonym : syns)=0A> {*=0A> *=A0 =A0 =A0 =A0 =A0 =A0 *=0A>= *=A0 =A0 =A0 =A0 =A0 =A0 Token newTok =3D=0A> new Token(nToken.startOffset= (),=0A> nToken.endOffset(), "SYNONYM");*=0A> *=A0 =A0 =A0 =A0 =A0 =A0=0A> n= ewTok.setTermBuffer(synonym.getToken().toCharArray(), 0,=0A> synonym.getTok= en().length());*=0A> *=A0 =A0 =A0 =A0 =A0 =A0 // set the=0A> position incre= ment to zero*=0A> *=A0 =A0 =A0 =A0 =A0 =A0 // this tells=0A> lucene the syn= onym is*=0A> *=A0 =A0 =A0 =A0 =A0 =A0 // in the exact=0A> same location as = the originating word*=0A> *=A0 =A0 =A0 =A0 =A0 =A0=0A> newTok.setPositionIn= crement(0);*=0A> *=A0 =A0 =A0 =A0 =A0 =A0 boostPayload =3D=0A> new=0A> Payl= oad(PayloadHelper.encodeFloat(synonym.getWieght()));*=0A> *=A0 =A0 =A0 =A0 = =A0 =A0=0A> newTok.setPayload(boostPayload);*=0A> *=0A> *=0A> I have put it= in the index time analyzer : this is my field=0A> definition:=0A> =0A> *= =0A> positionIn= crementGap=3D"100" >=0A> =A0 =A0 =A0 =0A> =A0 =A0 = =A0 =A0 class=3D"solr.WhitespaceTokenizerFactory"/>=0A> =A0 = =A0 =A0 =A0 class=3D"solr.StopFilterFactory" ignoreCase=3D"true= "=0A> words=3D"stopwords.txt"/>=0A> =A0 =A0 =A0 =A0 class=3D"so= lr.LowerCaseFilterFactory"/>=0A> =A0 =A0 =A0 =A0 class=3D"com.d= igitaltrowel.solr.DTSynonymFactory"=0A> FreskoFunction=3D"names_with_scores= Pipe23Columns.txt"=0A> ignoreCase=3D"true"=0A> expand=3D"false"/>=0A> =0A> = =A0 =A0 =A0 =A0 =0A> =A0 =A0 =A0 =A0 =0A> =A0 =A0 =A0 =0A> =A0 =A0 =A0 =0A> =A0 =A0 =A0 =A0 class=3D"solr.WhitespaceTokenizerFactory"/>=0A> =A0 =A0 =A0 =A0 class=3D"solr.LowerCaseFilterFactory"/>=0A> =A0 =A0 =A0 =A0 =0A> =A0 =A0= =A0 =A0 class=3D"solr.StopFilterFactory" ignoreCase=3D"true"= =0A> words=3D"stopwords.txt"/>=0A> =A0 =A0 =A0 =A0 =0A> = =A0 =A0 =A0 =A0 =0A> =A0 =A0 =A0 =0A> =A0 =A0 =0A> =0A> =0A> my similarity class is=0A> public class BoostingSymilarity = extends DefaultSimilarity=0A> {=0A> =0A> =0A> =A0 =A0 public BoostingSymila= rity(){=0A> =A0 =A0 =A0 =A0 super();=0A> =0A> =A0 }=0A> =A0 =A0 @Override= =0A> =A0 =A0 public=A0 float scorePayload(String field,=0A> byte [] payload= , int offset,=0A> int length)=0A> {=0A> double weight =3D PayloadHelper.de= codeFloat(payload, 0);=0A> return (float)weight;=0A> }=0A> =0A> @Override = public float coord(int overlap, int maxoverlap)=0A> {=0A> return 1.0f;=0A>= }=0A> =0A> @Override public float idf(int docFreq, int numDocs)=0A> {=0A> = return 1.0f;=0A> }=0A> =0A> @Override public float lengthNorm(String field= Name, int=0A> numTerms)=0A> {=0A> return 1.0f;=0A> }=0A> =0A> @Override pu= blic float tf(float freq)=0A> {=0A> return 1.0f;=0A> }=0A> }=0A> =0A> My p= roblem is that scorePayload method does not get called=0A> at search time= =0A> like the other methods in=A0 my similarity class.=0A> I tested and ver= ified it with break points.=0A> What am I doing wrong?=0A> I used solr 1.3 = and thinking of the payload boos support in=0A> solr 1.4.=0A> =0A> =0A> *= =0A> =0A=0A=0A --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org