Return-Path: X-Original-To: apmail-lucene-java-user-archive@www.apache.org Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CF9025B7D for ; Thu, 12 May 2011 05:00:54 +0000 (UTC) Received: (qmail 56056 invoked by uid 500); 12 May 2011 05:00:52 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 55764 invoked by uid 500); 12 May 2011 05:00:44 -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 55751 invoked by uid 99); 12 May 2011 05:00:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 May 2011 05:00:41 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of saurabhgokhale@gmail.com designates 209.85.216.176 as permitted sender) Received: from [209.85.216.176] (HELO mail-qy0-f176.google.com) (209.85.216.176) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 May 2011 05:00:35 +0000 Received: by qyk30 with SMTP id 30so860705qyk.14 for ; Wed, 11 May 2011 22:00:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=h0N85Qa6tAoayNBvl+X3v80kB6lHfnxc1QjILeVPaFg=; b=WubUeyjpOumT2jhhhIJNsQ4WfpXc1fAGlA5oAz+10/mViHuL/06spVYFvspYO8sNGd odSfjGCGRAlCbbIIgku6tWyzQBy0gqcCdV4e5bzb/fztoBoUMiIY/OZrtb/ExIcpjuBr ZY4McMmPyldc/9h/hUlVN+KXQphnEy+SRtgCc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=G8SrN7dVcbCqGFgpb7wV2iqrXj4Vl35mpoYJLqIj/ynXMpoQPuqnqud/qBtke/U5E9 LIsBjwmmP8GcghSLs/hCP3OXyZoG4JWd/xfZVgBSdrrGIEHERUVAlVTGDEOfVf2gNDz9 i1a1L2/kTptj1VJUU+NEsN5Tl92blkek8WW4k= MIME-Version: 1.0 Received: by 10.229.107.38 with SMTP id z38mr7399499qco.158.1305176414295; Wed, 11 May 2011 22:00:14 -0700 (PDT) Received: by 10.229.231.71 with HTTP; Wed, 11 May 2011 22:00:14 -0700 (PDT) Date: Thu, 12 May 2011 00:00:14 -0500 Message-ID: Subject: found workaround: Query on using Payload with MoreLikeThis class From: Saurabh Gokhale To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary=002354470f888b151b04a30d1059 --002354470f888b151b04a30d1059 Content-Type: text/plain; charset=ISO-8859-1 Hi All, I am not sure if any one got chance to go over my question (below). The question was to check if I can modify MoreLikeThis.like() result using index time boosting. I have found a work around as there is no easy way to influence MoreLikeThis result using index time payload value. The work around is to write class similar to MoreLikeThis (can not extend this call as it is final) and in the createQuery method of MoreLikeThis class change the Query class from TermQuery to PayloadTermQuery. Change: TermQuery tq = new TermQuery(new Term((String) ar[1], (String) ar[0])); To: Term payloadTerm = new Term((String) ar[1], (String) ar[0]); Query tq = new PayloadTermQuery(payloadTerm, new AveragePayloadFunction()); Thats it, rest of the MoreLikeThis code stays the same :) With this change, I could boost my MoreLikeThis result with the payload value setup at the index time If any one has any better thoughts, I would be glad to hear about them Thanks Saurabh On Tue, May 10, 2011 at 1:36 PM, Saurabh Gokhale wrote: > Hi, > > In the Lucene 2.9.4 project, there is a requirement to boost some of the > keywords in the document using payload. > > Now while searching, is there a way I can boost the MoreLikeThis result > using the index time payload values? > > Or can I merge MoreLikeThis output and PayloadTermQuery output somehow to > get the final percentage output? > --002354470f888b151b04a30d1059--