Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@www.apache.org Received: (qmail 27006 invoked from network); 16 Jun 2004 13:07:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 16 Jun 2004 13:07:57 -0000 Received: (qmail 87558 invoked by uid 500); 16 Jun 2004 13:07:25 -0000 Delivered-To: apmail-jakarta-lucene-user-archive@jakarta.apache.org Received: (qmail 86775 invoked by uid 500); 16 Jun 2004 13:07:14 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 86125 invoked by uid 99); 16 Jun 2004 13:07:07 -0000 Received: from [128.143.135.143] (HELO postfix.mail.ehatchersolutions.com) (128.143.135.143) by apache.org (qpsmtpd/0.27.1) with ESMTP; Wed, 16 Jun 2004 06:07:07 -0700 Received: from [127.0.0.1] (localhost [127.0.0.1]) by postfix.mail.ehatchersolutions.com (Postfix) with ESMTP id 0F10678CEB1 for ; Wed, 16 Jun 2004 09:06:55 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v613) In-Reply-To: <1314.143.106.120.195.1087389928.squirrel@www.ccuec.unicamp.br> References: <2510.143.106.120.195.1087312898.squirrel@www.ccuec.unicamp.br> <1314.143.106.120.195.1087389928.squirrel@www.ccuec.unicamp.br> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <097F133D-BF96-11D8-B5A8-000393A564E6@ehatchersolutions.com> Content-Transfer-Encoding: 7bit From: Erik Hatcher Subject: Re: How to use PhraseQuery Class? Date: Wed, 16 Jun 2004 09:06:53 -0400 To: "Lucene Users List" X-Mailer: Apple Mail (2.613) X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On Jun 16, 2004, at 8:45 AM, Daniel de Souza Teixeira wrote: > Do I need to use some special kind of Analyzer on the index method ? What analyzer did you use? SimpleAnalyzer lowercases.... > PhraseQuery query = new PhraseQuery(); > query.setSlop(2); > query.add(new Term("contents", "How")); > query.add(new Term("contents", "can")); > > System.out.println( "Query: " + query.toString()); > > Hits hits = searcher.search(query); And so your "How" term should be "how" in order to match what you indexed. Be sure to read and understand issues you can encounter with analysis in the picture, or in your case in the picture during indexing, but not during querying: http://wiki.apache.org/jakarta-lucene/AnalysisParalysis In other words, knowing *exactly* what you indexed is extremely vital in understanding issues with querying. Erik --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org