Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 66897 invoked from network); 25 Jun 2008 03:44:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Jun 2008 03:44:42 -0000 Received: (qmail 98563 invoked by uid 500); 25 Jun 2008 03:44:37 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 98520 invoked by uid 500); 25 Jun 2008 03:44: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 98507 invoked by uid 99); 25 Jun 2008 03:44:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Jun 2008 20:44:37 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of chris.lu@gmail.com designates 209.85.128.185 as permitted sender) Received: from [209.85.128.185] (HELO fk-out-0910.google.com) (209.85.128.185) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jun 2008 03:43:46 +0000 Received: by fk-out-0910.google.com with SMTP id 18so3055242fkq.5 for ; Tue, 24 Jun 2008 20:44:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=ORlxywByRHppYyE6b5CNjA2rVbZnTvqkqpG1jLJRUaU=; b=NbL1CodWYQkI4vzb4ICUQy+GAOc+VnTSR9lc59D3IBkAhR6+V+xMqwhpPCSgbzyF9d pwN6Cq1FuS8l8cQwR4OQxYI9GAho2VHhYb/9R/Z3QG/2Q79iXHpP26d66+9n6p7Y3MWs M6krgoGWbDh0tWU5HFUV61XgZDT7kMW3YrlFQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=cxDHmQSVg5mJN03QvSSup9J8rT5ZS2mLtbkwvcwqMzdxz8oAfBN+0Jv9tESrQ9O+6e FtfFOBBeMSGADdBMbUrmFF2LGvoFn81kVZ45QLrpOezAqURQqFg2uQCR+vgYkCBHSDaK CX0fFO98LP+6shfV6mHEjY7dFkhSnS5Jld41E= Received: by 10.78.193.19 with SMTP id q19mr3614317huf.79.1214365443641; Tue, 24 Jun 2008 20:44:03 -0700 (PDT) Received: by 10.78.155.18 with HTTP; Tue, 24 Jun 2008 20:44:03 -0700 (PDT) Message-ID: <6e3ae6310806242044j512c5a1dteacc673445e10cce@mail.gmail.com> Date: Tue, 24 Jun 2008 20:44:03 -0700 From: "Chris Lu" To: java-user@lucene.apache.org Subject: Re: lucene query parser for double-worded term query In-Reply-To: <359a92830806241802s154b0afsfe4531de398c00fd@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_32893_32831202.1214365443344" References: <6e3ae6310806241714q71284d3csb8f19d7e0f681856@mail.gmail.com> <6e3ae6310806241740p6e949c20ha07c00b9afb1ec8b@mail.gmail.com> <359a92830806241802s154b0afsfe4531de398c00fd@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_32893_32831202.1214365443344 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Erick, Thanks! It's the analyzer problem. I should have used the same analyzer, KeywordAnalyzer, to create the query parser. Thanks a lot! -- Chris Lu ------------------------- Instant Scalable Full-Text Search On Any Database/Application site: http://www.dbsight.net demo: http://search.dbsight.com Lucene Database Search in 3 minutes: http://wiki.dbsight.com/index.php?title=Create_Lucene_Database_Search_in_3_minutes DBSight customer, a shopping comparison site, (anonymous per request) got 2.6 Million Euro funding! On Tue, Jun 24, 2008 at 6:02 PM, Erick Erickson wrote: > What analyzers are you using for both indexing and querying? > Have you looked at your index with Luke to see what's actually > in the index? The reason I'm asking is I'm wondering whether you > are having capitalization issues. That is, your index analyzer > lower cases the tokens and your query analyzer doesn't, or > vice-versa... > > And Query.toString is your friend too . > > Best > Erick > > On Tue, Jun 24, 2008 at 8:40 PM, Chris Lu wrote: > > > Yonik, Thanks for your quick reply! > > > > But I found after backslash escape spaces, both > > tags:San\ Francisco > > tags:"San\ Francisco" > > turns into PhraseQuery, just like tags:"San Francisco", still no results > > returned. > > > > Maybe Lucene Query Parser does not handle this case? > > > > -- > > Chris Lu > > ------------------------- > > Instant Scalable Full-Text Search On Any Database/Application > > site: http://www.dbsight.net > > demo: http://search.dbsight.com > > Lucene Database Search in 3 minutes: > > > > > http://wiki.dbsight.com/index.php?title=Create_Lucene_Database_Search_in_3_minutes > > DBSight customer, a shopping comparison site, (anonymous per request) got > > 2.6 Million Euro funding! > > > > On Tue, Jun 24, 2008 at 5:26 PM, Yonik Seeley wrote: > > > > > You can backslash escape spaces, so these should both work: > > > tags:San\ Francisco > > > tags:"San\ Francisco" > > > > > > -Yonik > > > > > > On Tue, Jun 24, 2008 at 8:14 PM, Chris Lu wrote: > > > > I have a tags field. And each tag can have multiple words, like "San > > > > Francisco". Each tag is analyzed into Keyword field like this > > > > new Field("tags", "San Francisco",Field.Store.YES, > > > > Field.Index.UN_TOKENIZED) > > > > > > > > It should be searchable if using TermQuery directly, like > > > > new TermQuery(new Term("tags", "San Francisco")) > > > > > > > > But how to achieve this via Lucene Query Parser? If using > > > > tags:"San Francisco" > > > > It's considered a phrase, and turned into term search of tags:San and > > > > tags:Francisco, which will not return results. > > > > > > > > Thanks for any advice! > > > > > > > > -- > > > > Chris Lu > > > > ------------------------- > > > > Instant Scalable Full-Text Search On Any Database/Application > > > > site: http://www.dbsight.net > > > > demo: http://search.dbsight.com > > > > Lucene Database Search in 3 minutes: > > > > > > > > > > http://wiki.dbsight.com/index.php?title=Create_Lucene_Database_Search_in_3_minutes > > > > DBSight customer, a shopping comparison site, (anonymous per request) > > got > > > > 2.6 Million Euro funding! > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > > > For additional commands, e-mail: java-user-help@lucene.apache.org > > > > > > > > > ------=_Part_32893_32831202.1214365443344--