Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 65418 invoked from network); 11 Nov 2006 20:51:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Nov 2006 20:51:42 -0000 Received: (qmail 24571 invoked by uid 500); 11 Nov 2006 20:51:47 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 23575 invoked by uid 500); 11 Nov 2006 20:51:45 -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 23564 invoked by uid 99); 11 Nov 2006 20:51:45 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of jeff.storey@dac.us designates 216.85.37.218 as permitted sender) Received: from [216.85.37.218] (HELO arlington1mail.dac.us) (216.85.37.218) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 11 Nov 2006 12:51:43 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Partial Word Matches Date: Sat, 11 Nov 2006 15:50:48 -0500 Message-ID: <572725A4D5BFDE41922873B5199337D4010D7833@arlington1mail.dac.us> In-Reply-To: <8c0c601f0611111205i5af0ac58y65bcdc3a4376f5cd@mail.gmail.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Partial Word Matches Thread-Index: AccFzNrbZ7YKM/mJSz6NMs0BnzOqowABaEeA From: "Storey, Jeff" To: X-Virus-Checked: Checked by ClamAV on apache.org For proprietary reasons, I cannot post code samples, but I can give you more details as to what I am doing. I am basically trying to search a directory of text files. Step 1: Create an IndexWriter for the directory being searched. Step 2: For each text file, create a new Document object and add the document title and content as fields to this Lucene document. Add these documents to the IndexWriter. Step 3: Create a QueryParser and parse a user entered query. Step 4: Create an IndexSearcher to search the directory created by the IndexWriter. Step 5: Use the search method of the IndexSearcher to search the parsed query created in Step 3. That's it. Is this the proper way to be doing searching? Thanks. Jeff -----Original Message----- From: Paul Borgermans [mailto:paul.borgermans@gmail.com]=20 Sent: Saturday, November 11, 2006 3:06 PM To: java-user@lucene.apache.org Subject: Re: Partial Word Matches Indeed, the only way this can happen as far as I know Lucene is by using a stemmer during indexing, the standard analyzer won't result in such behaviour. hth Paul On 11/11/06, Erick Erickson wrote: > > That's not the default behavior, so I'm perplexed. Normally, you have to > go > to considerable effort to get partial matches.... > > What analyzers are you using at both index and query time? Perhaps as > short > a code snippet as you could make showing this behavior would be a good > thing > to post. I flat guarantee folks will look at it. But please make it short > . > > Best > ERick > > On 11/11/06, Storey, Jeff wrote: > > > > Hi. I'm using Lucene to do some searching (using the Searcher object and > > passing it a ParsedQuery). I search for a word such as "long" and it is > > returning partial matches, such as "belong" and "along." Is there a way > > to turn off this behavior and only match whole words? > > > > > > > > Thank you, > > > > Jeff > > > > > > > > > > > > --=20 http://walhalla.wordpress.com --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org