Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 47941 invoked from network); 10 Mar 2008 16:21:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Mar 2008 16:21:12 -0000 Received: (qmail 72761 invoked by uid 500); 10 Mar 2008 16:21:03 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 72381 invoked by uid 500); 10 Mar 2008 16:21: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 72370 invoked by uid 99); 10 Mar 2008 16:21:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Mar 2008 09:21:02 -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 [213.162.48.15] (HELO soufre.accelance.net) (213.162.48.15) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Mar 2008 16:20:23 +0000 Received: from [192.168.3.101] (LSt-Amand-152-32-31-90.w82-127.abo.wanadoo.fr [82.127.74.90]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by soufre.accelance.net (Postfix) with ESMTP id 6BE05452CB for ; Mon, 10 Mar 2008 17:20:31 +0100 (CET) Message-ID: <47D55FCE.8030706@garambrogne.net> Date: Mon, 10 Mar 2008 17:20:30 +0100 From: Mathieu Lecarme User-Agent: Thunderbird 2.0.0.12 (X11/20080213) MIME-Version: 1.0 To: java-user@lucene.apache.org Subject: Re: Best way to do Query inflation? References: In-Reply-To: X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org https://admin.garambrogne.net/projets/revuedepresse/browser/trunk/src/java/lexicon/src/java/org/apache/lucene/lexicon/QueryUtils.java M. Itamar Syn-Hershko a écrit : > Hi all, > > I'm looking for the best way to inflate a query, so a query like: "synchronous AND colour" -- will become something like this: > > "(synchronous OR asynchronous OR bsynchornous OR synchronos OR asynchronos OR bsynchornos) AND (colour OR acolour OR bcolour OR color OR acolor OR bcolor)". > > I'm doing two-fold action - creating another instance of the word without a specific letter(s), and then adding initial letters to all the resulting set of words. The resulting list of words should be OR'ed and replace the original word from the original query (so "colour" becomes "(colour OR acolour OR bcolour OR color OR acolor OR bcolor)"). This is for making Hebrew queries return more precise results, don't try to find the logic in English :) > > What I'm looking for is the proper way and place to make the actual query expanding process. Keep in mind I will want to be able to access the complete list of words later so I could use them to highligh results in the opened document. If I could access the terms object directly somehow and replace each item with and OR'd object that would be ideal I think. > > BTW, I have already established that I will have to write my own query parser derived from QueryParserBase directly, and my own Lexer, since Hebrew has some unique stuff that sometimes confuse Lucene's default. The tweaks I'm about to make should work for both Hebrew AND English, so perhaps will become the standard way of doing things... > > Thanks in advance for any help, > > Itamar. > > > > ------------------------------------------------------------------------ > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org