Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 82812 invoked from network); 6 Apr 2007 09:56:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Apr 2007 09:56:07 -0000 Received: (qmail 50698 invoked by uid 500); 6 Apr 2007 09:56:07 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 50656 invoked by uid 500); 6 Apr 2007 09:56:07 -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 50645 invoked by uid 99); 6 Apr 2007 09:56:06 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Apr 2007 02:56:06 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [213.92.5.126] (HELO slim-4a.inet.it) (213.92.5.126) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Apr 2007 02:55:58 -0700 Received: from host130-238-static.34-88-b.business.telecomitalia.it ([::ffff:88.34.238.130]) by slim-4a.inet.it via I-SMTP-5.4.4-547 id ::ffff:88.34.238.130+C5ptVpe3NeO; Fri, 06 Apr 2007 11:55:27 +0200 Message-ID: <461619F7.2030206@buongiorno.com> Date: Fri, 06 Apr 2007 11:59:19 +0200 From: Roberto Fonti User-Agent: Mozilla Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: java-user@lucene.apache.org Subject: UN_TOKENIZED and StandardAnalyzer Content-Type: multipart/alternative; boundary="------------070202090601030002010801" X-Virus-Checked: Checked by ClamAV on apache.org --------------070202090601030002010801 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Hi All, I'm indexing categories with this code: for (Category category : item.getCategories()) { lucene_doc.add(new Field( "CATEGORY", category.getName(), Field.Store.NO, Field.Index.UN_TOKENIZED)); } And searching using the query: String query = "CATEGORY:("+category.getName()+")"; I've configured to use the StandardAnalyzer both in the IndexWriter for the QueryParser. Everything goes fine BUT with categories that contains whitespaces (or other chars that get tokenized). * If category is "sport" - ok, I get the result from the search * If category is "winter sport" - I get no result from search I've tried with a number of search syntax: +CATEGORY:"winter sport" +CATEGORY:winter +CATEGORY:sport +CATEGORY:(winter sport) and other... but none of them work. What's wrong with that? By the way, using the KeywordAnalyzer it works, but it is not the correct analyzer for my application. Shouldn't the Analyzer be ignored for a Field.Index.UN_TOKENIZED field? Thanks, Roberto --------------070202090601030002010801--