Return-Path: X-Original-To: apmail-lucene-solr-user-archive@minotaur.apache.org Delivered-To: apmail-lucene-solr-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9D0F0624F for ; Tue, 28 Jun 2011 05:39:47 +0000 (UTC) Received: (qmail 34523 invoked by uid 500); 28 Jun 2011 05:39:44 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 33717 invoked by uid 500); 28 Jun 2011 05:39:34 -0000 Mailing-List: contact solr-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-user@lucene.apache.org Delivered-To: mailing list solr-user@lucene.apache.org Received: (qmail 33709 invoked by uid 99); 28 Jun 2011 05:39:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Jun 2011 05:39:29 +0000 X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of shariqnitt@gmail.com designates 209.85.215.176 as permitted sender) Received: from [209.85.215.176] (HELO mail-ey0-f176.google.com) (209.85.215.176) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Jun 2011 05:39:22 +0000 Received: by eya28 with SMTP id 28so2588545eya.35 for ; Mon, 27 Jun 2011 22:39:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=42p9agOd/mWD97MnbSEGmD2BVfW9QXM7gpPdp7DMVQ0=; b=U5M/RXTwErRGGNzamYGmXPAmXe/0oYB7uiPI2pAwDVFB3lS6UEJ5i01V7/fNYxN0KL h3H8TZX4hab3OQegYg153z63lw05zMo/cd7M/2zXcfa7FTSmjhk6T+y4i5n15CKwGLyo uJD1OBIqZvBwMY4fWzDjag/tj6jXZP9rp9Ets= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=F3CgLgOa4FQOImkAUNEuOLPH1IW0iqsQ1tsxN+kFIRgF2inwCT88L89CQo7hByEF1l dRRJn/Mi3BIb/T5BgL5oez6xXZdS2fJPr7quGcBoVNXSEn/4tghsIkYWrDyWn1uklHu7 elB3B4Sgmaagq/dQ6F8GfrZGOonZcyKr4xT8E= MIME-Version: 1.0 Received: by 10.14.120.201 with SMTP id p49mr4476135eeh.179.1309239541712; Mon, 27 Jun 2011 22:39:01 -0700 (PDT) Received: by 10.213.31.209 with HTTP; Mon, 27 Jun 2011 22:39:01 -0700 (PDT) In-Reply-To: <1309229848087-3116288.post@n3.nabble.com> References: <1309229848087-3116288.post@n3.nabble.com> Date: Tue, 28 Jun 2011 11:09:01 +0530 Message-ID: Subject: Re: Analyzer creates PhraseQuery From: Mohammad Shariq To: solr-user@lucene.apache.org Content-Type: multipart/alternative; boundary=e0cb4e43ced1cf466e04a6bf1509 X-Virus-Checked: Checked by ClamAV on apache.org --e0cb4e43ced1cf466e04a6bf1509 Content-Type: text/plain; charset=ISO-8859-1 I guess 'to' may be listed in 'stopWords' . On 28 June 2011 08:27, entdeveloper wrote: > I have an analyzer setup in my schema like so: > > > > > maxGramSize="2"/> > > > What's happening is if I index a term like "toys and dolls", if I search > for > "to", I get no matches. The debug output in solr gives me: > > to > to > PhraseQuery(autocomplete:"t o to") > autocomplete:"t o to" > > Which means it looks like the lucene query parser is turning it into a > PhraseQuery for some reason. The explain seems to confirm that this > PhraseQuery is what's causing my document to not match: > > 0.0 = (NON-MATCH) weight(autocomplete:"t o to" in 82), product of: > 1.0 = queryWeight(autocomplete:"t o to"), product of: > 6.684934 = idf(autocomplete: t=60 o=68 to=14) > 0.1495901 = queryNorm > 0.0 = fieldWeight(autocomplete:"t o to" in 82), product of: > 0.0 = tf(phraseFreq=0.0) > 6.684934 = idf(autocomplete: t=60 o=68 to=14) > 0.1875 = fieldNorm(field=autocomplete, doc=82) > > But why? This seems like it should match to me, and indeed the Solr > analysis > tool highlights the matches (see image), so something isn't lining up > right. > > > http://lucene.472066.n3.nabble.com/file/n3116288/Screen_shot_2011-06-27_at_7.55.49_PM.png > > In case you're wondering, I'm trying to implement a semi-advanced > autocomplete feature that goes beyond using what a simple EdgeNGram > analyzer > could do. > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/Analyzer-creates-PhraseQuery-tp3116288p3116288.html > Sent from the Solr - User mailing list archive at Nabble.com. > -- Thanks and Regards Mohammad Shariq --e0cb4e43ced1cf466e04a6bf1509--