Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 88276 invoked from network); 15 Dec 2007 05:04:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Dec 2007 05:04:44 -0000 Received: (qmail 49374 invoked by uid 500); 15 Dec 2007 05:04:27 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 49343 invoked by uid 500); 15 Dec 2007 05:04:27 -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 49328 invoked by uid 99); 15 Dec 2007 05:04:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Dec 2007 21:04:27 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of serera@gmail.com designates 72.14.202.177 as permitted sender) Received: from [72.14.202.177] (HELO ro-out-1112.google.com) (72.14.202.177) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 15 Dec 2007 05:04:05 +0000 Received: by ro-out-1112.google.com with SMTP id m6so1887940roe.7 for ; Fri, 14 Dec 2007 21:04:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=NMf1cflAu4DQf1VrssSZnFASh8Ilza4MX0zqGJz7ZBk=; b=hkHSNvoQW+0Sa1Dt8bFgBG2Q5Mzl3F1J4FPPoSxPVAuoAKbenXpMh8b0eoOukjWjuoxbFZP6p0Gw1LkjVn/nqUxdUrZ7Z9DTLPMB8OUTnq6oPme8y+aTpT0FW7/4vIpUNV0BQB/Holn/0xihP3FVnM6H0pw3Hv2WAFKXBY4ZZYs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=hDZRaE+mCgUcDRvbLQe13FkVtUOfh/9xwiYfEIDOcPKm6alZXZXfS70tjFBfFdps+qPdfCj2aiqW7HJkNywav7WHY+rPboWvzy+O/OKYuw0nVqr/Tj4KI7h5QhvgEY0L+dsl5UNKXmQRkeT2h1t1IEAycgpY2WGXRWT6+Okne7k= Received: by 10.141.113.6 with SMTP id q6mr2483283rvm.135.1197695047934; Fri, 14 Dec 2007 21:04:07 -0800 (PST) Received: by 10.141.70.4 with HTTP; Fri, 14 Dec 2007 21:04:07 -0800 (PST) Message-ID: <786fde50712142104k1ffd033bnd02a742134a09df@mail.gmail.com> Date: Sat, 15 Dec 2007 07:04:07 +0200 From: "Shai Erera" To: java-user@lucene.apache.org Subject: Re: (~) opertor query.... In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1628_10959728.1197695047940" References: <9312093579B72048B1E5659DC3EC7F39022E9330@hstmsg005.corp.satyam.ad> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_1628_10959728.1197695047940 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline You can look at org.apache.lucene.search.MultiPhraseQuery which does something similar to what you ask. From its javadoc: * To use this class, to search for the phrase "Microsoft app*" first use * add(Term) on the term "Microsoft", then find all terms that have "app" as * prefix using IndexReader.terms(Term), and use MultiPhraseQuery.add(Term[] * terms) to add them to the query. It works for simple phrases and I don't know if it works for fuzzy phrases as well ... however I believe it can be tweaked to work for fuzzy phrases also. On Dec 15, 2007 1:26 AM, Chris Hostetter wrote: > > : I am parsing this query: "Auto* machine"~4. > : > : Will it work? If yes then right now it's not working. Can > : anyone help on this? > > Tt depends, what do you want it to do? :) > > If you are hoping it will match documents that contain a word that starts > with "Auto" withing a distance of 4 words from the word "machine" then no, > the query parser doesn't work that way. phrase queries (aka: proximty > queries) as supported by the QueryParser can only match simple words in > the phrase, not other complex query types ... but you could build your own > query parser that leveraged the SpanQuery family of queries to do > something like this. > > > > -Hoss > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > > -- Regards, Shai Erera ------=_Part_1628_10959728.1197695047940--