Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 29068 invoked from network); 6 Aug 2009 15:19:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 6 Aug 2009 15:19:32 -0000 Received: (qmail 48531 invoked by uid 500); 6 Aug 2009 15:12:08 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 47065 invoked by uid 500); 6 Aug 2009 15:12: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 46068 invoked by uid 99); 6 Aug 2009 15:02:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Aug 2009 15:02:15 +0000 X-ASF-Spam-Status: No, hits=-1.0 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of paul_t100@fastmail.fm designates 66.111.4.29 as permitted sender) Received: from [66.111.4.29] (HELO out5.smtp.messagingengine.com) (66.111.4.29) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Aug 2009 15:02:04 +0000 Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id AE27F1578; Thu, 6 Aug 2009 11:01:43 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Thu, 06 Aug 2009 11:01:43 -0400 X-Sasl-enc: 103IkAXVeh4YNgvhh87s3ys9B9bBc/D7WsmoZyHmXiwl 1249570903 Received: from macbook.lan (unknown [217.155.98.246]) by mail.messagingengine.com (Postfix) with ESMTPA id D27783525; Thu, 6 Aug 2009 11:01:42 -0400 (EDT) Message-ID: <4A7AF056.9060406@fastmail.fm> Date: Thu, 06 Aug 2009 16:01:42 +0100 From: Paul Taylor Reply-To: paul_t100@fastmail.fm User-Agent: Thunderbird 2.0.0.22 (Macintosh/20090605) MIME-Version: 1.0 To: Shai Erera CC: java-user@lucene.apache.org Subject: Re: StandardFilter not handling dots as exptected ? References: <4A7AE2B2.8010908@fastmail.fm> <359a92830908060727y69100acdy414f6e292dbcb5d4@mail.gmail.com> <4A7AECA5.5040100@fastmail.fm> <786fde50908060757o3ff5b05t16bf7c667d3d91d@mail.gmail.com> In-Reply-To: <786fde50908060757o3ff5b05t16bf7c667d3d91d@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Shai Erera wrote: > I see you index R.E.S. and search for R.E.S (note the dot that's > missing in the query at the end). Can you try to query w/ the dot? Yes if you search with the dot it works (i mentioned this in the first email) so it appears when the field is being indexed its no tremoving the last dot. > > On Thu, Aug 6, 2009 at 5:45 PM, Paul Taylor > wrote: > > Erick Erickson wrote: > > I don't see anything obvious in the code. > > Are you using the same analzer at query time as at index time? > > Yes, I do I have created a testcase now, that fails > > > import org.apache.lucene.analysis.Analyzer; > import org.apache.lucene.store.RAMDirectory; > import org.apache.lucene.index.IndexWriter; > import org.apache.lucene.document.Document; > import org.apache.lucene.document.Field; > import org.apache.lucene.search.IndexSearcher; > import org.apache.lucene.search.Query; > import org.apache.lucene.search.Hits; > import org.apache.lucene.queryParser.QueryParser; > import junit.framework.TestCase; > > public class RESTest extends TestCase { > public void testMatchAcronymns() throws Exception { > Analyzer analyzer = new StandardUnaccentAnalyzer(); > RAMDirectory dir = new RAMDirectory(); > IndexWriter writer = new IndexWriter(dir, analyzer, true, > IndexWriter.MaxFieldLength.LIMITED); > Document doc = new Document(); > doc.add(new Field("name", "R.E.S.", Field.Store.YES, > Field.Index.ANALYZED)); > writer.addDocument(doc); > writer.close(); > > IndexSearcher searcher = new IndexSearcher(dir); > Query q = new QueryParser("name", analyzer).parse("R.E.S"); > System.out.println(q.toString()); > Hits hits = searcher.search(q); > assertEquals(1, hits.length()); > > } > } > > > I'd also get a copy of Luke and examine your index to see what > is actually getting put in it, and query.toString might help. > > Query to string returns > name:r.e.s > > Paul > > > --------------------------------------------------------------------- > 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