Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 58842 invoked from network); 22 Mar 2010 21:49:21 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 22 Mar 2010 21:49:21 -0000 Received: (qmail 75031 invoked by uid 500); 22 Mar 2010 21:49:20 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 74984 invoked by uid 500); 22 Mar 2010 21:49:20 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 74977 invoked by uid 99); 22 Mar 2010 21:49:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Mar 2010 21:49:20 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,SPF_HELO_PASS,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Mar 2010 21:49:13 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1NtpUS-0007No-E2 for java-dev@lucene.apache.org; Mon, 22 Mar 2010 14:48:52 -0700 Message-ID: <27993221.post@talk.nabble.com> Date: Mon, 22 Mar 2010 14:48:52 -0700 (PDT) From: zsl To: java-dev@lucene.apache.org Subject: Re: Set IDF value manually on a search query In-Reply-To: <4BA7B88E.3050204@getopt.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: zashael@gmail.com References: <27988911.post@talk.nabble.com> <9ac0c6aa1003220936x79687426mc7c292e46d2b8aa9@mail.gmail.com> <27989419.post@talk.nabble.com> <4BA7B88E.3050204@getopt.org> X-Virus-Checked: Checked by ClamAV on apache.org Thank you so much, gonna try both options. Im trying to find some Similarity examples too. Andrzej Bialecki wrote: > > On 2010-03-22 18:06, zsl wrote: >> >> I was thinking about that, but i dont know if it is the best option. Ty. > > There is a certain trick to do this with the current API (let's hope the > new API is more .. flexible .. ? ;) ) > > Implement a dummy Searcher that delegates most of its work to the real > Searcher, except for docFreq(Term), where you return your arbitrary > values. Then do Searcher.rewrite(Query) to expand the query, and then > Query.weight(Searcher) to obtain a Weight - which uses your modified IDF. > > Finally, use this Weight to run a query against your real Searcher. > > You can see this approach implemented here: > > https://issues.apache.org/jira/browse/SOLR-1632 > > though this contains some Solr-specific scaffolding, too. > > > -- > Best regards, > Andrzej Bialecki <>< > ___. ___ ___ ___ _ _ __________________________________ > [__ || __|__/|__||\/| Information Retrieval, Semantic Web > ___|||__|| \| || | Embedded Unix, System Integration > http://www.sigram.com Contact: info at sigram dot com > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-dev-help@lucene.apache.org > > > -- View this message in context: http://old.nabble.com/Set-IDF-value-manually-on-a-search-query-tp27988911p27993221.html Sent from the Lucene - Java Developer mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org