Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 34150 invoked from network); 30 Oct 2007 16:29:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Oct 2007 16:29:46 -0000 Received: (qmail 90139 invoked by uid 500); 30 Oct 2007 16:22:37 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 90115 invoked by uid 500); 30 Oct 2007 16:22:37 -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 90100 invoked by uid 99); 30 Oct 2007 16:22:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Oct 2007 09:22:37 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [194.125.145.37] (HELO mercury.propylon.com) (194.125.145.37) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Oct 2007 16:22:40 +0000 Received: from propylon-sdsl.sdsl.esat.net ([193.120.101.26] helo=[192.168.213.155]) by mercury.propylon.com with esmtp (Exim 4.50) id 1Imtns-0003aP-8l for java-user@lucene.apache.org; Tue, 30 Oct 2007 16:19:07 +0000 Message-ID: <47275A29.7090108@propylon.com> Date: Tue, 30 Oct 2007 16:22:01 +0000 From: John Byrne User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: java-user@lucene.apache.org References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 193.120.101.26 X-SA-Exim-Mail-From: john.byrne@propylon.com Subject: Re: Looking for "Exact match but no other terms"... how to express it? X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on mercury.propylon.com X-Spam-Level: X-SA-Exim-Version: 4.2 (built Thu, 03 Mar 2005 10:44:12 +0100) X-SA-Exim-Scanned: Yes (on mercury.propylon.com) X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=0.1 required=5.0 tests=AWL autolearn=failed version=3.0.3 Tobias Hill wrote: > I want to match on the exact phrase "foo bar dot" on a > specific field on my set of documents. > > I only want results where that field has exactly "foo bar dot" > and no more terms. I.e. A document with "foo bar dot alu" > should not match. > > A phrase query with slop 0 seems resonable but how do I > express "but nothing more than these terms". > > Thankful for your feedback on this! > Tobias > > You can do this by storing the text in an un-tokenized field. This is an option when you create the field. use "Field.Index.UN_TOKENIZED" as the option when you create the field. Then individual terms or phrases will not match that field. You will still be able to match it with the exact text, a wildcard query, or a range query. So in your case, if the field contained "foo bar dot" you would not get a hit for "foo bar dot alu", but you would for "foo bar dot", "foo*", "f*" or even "*". Hope that helps! Regards, John. --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org