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 5E363F169 for ; Mon, 8 Apr 2013 16:19:05 +0000 (UTC) Received: (qmail 96888 invoked by uid 500); 8 Apr 2013 16:19:03 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 96811 invoked by uid 500); 8 Apr 2013 16:19: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 96801 invoked by uid 99); 8 Apr 2013 16:19:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Apr 2013 16:19:02 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jdevgl@gmail.com designates 209.85.215.174 as permitted sender) Received: from [209.85.215.174] (HELO mail-ea0-f174.google.com) (209.85.215.174) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Apr 2013 16:18:55 +0000 Received: by mail-ea0-f174.google.com with SMTP id m14so2357302eaj.5 for ; Mon, 08 Apr 2013 09:18:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=HvcucYlIndlac5JQe0QFFDAGp59U6LW1XWoPTzq1CT0=; b=UNyiR27cL3J1tTUcwn5LTkEtGJ8TWLD+JswArItYy/8Y9g5WtLE8vO/g5AQKHiIXZt gcOXKjMZHwhyGl4NFKBvn5deQTpjT82ifiZ9htvN9sRjIBT+67if+7GvrOJ1QHxZ80bu yNJJVv51pK5f19gG78Ute7hE1Htspej5PcUgNoGohgSBbFDf9Jxg9Ews5whBOeQcduLp F8HKAACuZ37QjTIZgfyZl/1j+uYpoodGIOaTUFiBIKi/2FiuePAobJf76/uLDw/VX5IK FQl64UwT3KH7QD4peVvzWfo1obRdIKe1HgeOMq2WxqcAv5e7E9ZBWI98CijBC+VSdOTq mzhw== X-Received: by 10.14.104.6 with SMTP id h6mr10996202eeg.5.1365437915313; Mon, 08 Apr 2013 09:18:35 -0700 (PDT) Received: from [192.168.20.93] (LPuteaux-151-41-16-99.w217-128.abo.wanadoo.fr. [217.128.31.99]) by mx.google.com with ESMTPS id n2sm32945399eeo.10.2013.04.08.09.18.34 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 08 Apr 2013 09:18:34 -0700 (PDT) Message-ID: <5162EDD9.1030400@gmail.com> Date: Mon, 08 Apr 2013 18:18:33 +0200 From: "G.Long" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: java-user@lucene.apache.org Subject: fuzzy query on phrases Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi :) I'm using Lucene 3.1 and I would like to use fuzzy query on a field which contains the title of my document. This field is indexed and stored using the standard analyzer. I found the ComplexPhraseQueryParser class which seems to support fuzzy option. Here is the code I'm using to create my query: ComplexPhraseQueryParser parser = new ComplexPhraseQueryParser(Version.LUCENE_31, "title", new StandardAnalyzer(Version.LUCENE_31)); parser.setFuzzyMinSim(new Float(0.8)); Query queryElmt = parser.parse("the title to find"); query.add(queryElmt, Occur.MUST); The boolean query at the end is for other fields with mandatory values. The problem is the generated query is: +(title:the title:title title:to title:find) There is no sign of the fuzzy attribute (~0.8). Did I do something wrong? ps: I know I can create a FuzzyQuery for each word of the title and add them all to the boolean query. This works find but it is slow and I need to do a lot of queries like this one. Thank you :) Gary --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org