Return-Path: X-Original-To: apmail-lucene-lucene-net-user-archive@www.apache.org Delivered-To: apmail-lucene-lucene-net-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 980909BD0 for ; Tue, 26 Jun 2012 21:19:24 +0000 (UTC) Received: (qmail 17491 invoked by uid 500); 26 Jun 2012 21:19:24 -0000 Delivered-To: apmail-lucene-lucene-net-user-archive@lucene.apache.org Received: (qmail 17437 invoked by uid 500); 26 Jun 2012 21:19:24 -0000 Mailing-List: contact lucene-net-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: lucene-net-user@lucene.apache.org Delivered-To: mailing list lucene-net-user@lucene.apache.org Received: (qmail 17429 invoked by uid 99); 26 Jun 2012 21:19:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jun 2012 21:19:24 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FSL_RCVD_USER,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of itamar.synhershko@gmail.com designates 209.85.213.176 as permitted sender) Received: from [209.85.213.176] (HELO mail-yx0-f176.google.com) (209.85.213.176) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jun 2012 21:19:20 +0000 Received: by yenl5 with SMTP id l5so467702yen.35 for ; Tue, 26 Jun 2012 14:18:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=K4CBnKNLnwW8LIFr8WDuEVlSEEAMIW0hJGcKWehd0wQ=; b=YDWt6mg9gC9OsPX+umrelkbppKSterr2QwRQzg+kfLqgJSW3N9eZJKvAI9xZiNWT7a zunDBMF/b/Fejhl2g0qEchhGGg0CfyqrXDOuZjWUF/tHhD7WWV+WssE1CfC/x4r/XlRe Ua9CoW0rS5fQYnWNrqPdjmEdHAyIXcRdEMsa1JoMyFoNBBTVQqFc5/ejDUFbvBlRA4vk 7MC3f2G9Zq4r2D2pC6gerpR/ngg4QTfS9vvNRvb0SLfdqB6Mujv6JpLwzLmP/x3NaJ+z Zh67XD8x1FfLUdNmjIEWLsO0NIGRFGXgsJn4Zw+Uds0rKeJRiq1dcOejzfdlFeNV2POk 2s/w== MIME-Version: 1.0 Received: by 10.50.85.196 with SMTP id j4mr12412244igz.30.1340745539259; Tue, 26 Jun 2012 14:18:59 -0700 (PDT) Sender: itamar.synhershko@gmail.com Received: by 10.231.46.209 with HTTP; Tue, 26 Jun 2012 14:18:59 -0700 (PDT) In-Reply-To: References: Date: Wed, 27 Jun 2012 00:18:59 +0300 X-Google-Sender-Auth: ebzg8nHIr1KcXIFJUh8Q78ZsF4E Message-ID: Subject: Re: SPAM-HIGH: Disparity between API usage and Luke From: Itamar Syn-Hershko To: lucene-net-user@lucene.apache.org Content-Type: multipart/alternative; boundary=e89a8f3b9beb9a0e5d04c366a5f1 X-Virus-Checked: Checked by ClamAV on apache.org --e89a8f3b9beb9a0e5d04c366a5f1 Content-Type: text/plain; charset=ISO-8859-1 It is, if you have any uppercase letters for example. If StandardAnalyzer is passed to QueryParser and you search on a non-analyzed field, you won't be able to find it. On Wed, Jun 27, 2012 at 12:15 AM, Rob Cecil wrote: > Well the field is "Id" - which contains unique, non-recurring terms. So I > don't think mapping it to Field.Index.ANALYZED makes sense, does it? If it > is mapped as NOT_ANALYZED, it is still indexed, so should I be able to > issue a query like "Id:BAUER*" ? > > On Tue, Jun 26, 2012 at 3:06 PM, Lingam, ChandraMohan J < > chandramohan.j.lingam@intel.com> wrote: > > > QueryParser has no knowledge of how data was indexed. For your scenario, > > I don't believe you would be able to use Query Parser with standard > > analyzer when data was originally indexed with Field.Index.NOT_ANALYZED > > option. > > > > Interesting question is why is luke working/finding the match? I would > > have expected Luke to not find any matches. > > > > > > -----Original Message----- > > From: Rob Cecil [mailto:rob.cecil@gmail.com] > > Sent: Tuesday, June 26, 2012 12:54 PM > > To: lucene-net-user@lucene.apache.org > > Subject: Re: SPAM-HIGH: Disparity between API usage and Luke > > > > I can definitely try that. I just expected QueryParser would respect the > > case of the source string. I was hoping to avoid using the Query API > > per-se, and just let the parser to the work for me. > > > > On Tue, Jun 26, 2012 at 1:19 PM, Lingam, ChandraMohan J < > > chandramohan.j.lingam@intel.com> wrote: > > > > > >> var query = _parser.Parse("Id:BAUER*"); > > > > > > In your code, most likely, the value got converted to lower case (i.e. > > > bauer*) by the parse statement. > > > Whereas indexed value is in upper case as it is not analyzed (from > > > screen shot). > > > > > > Can you explicitly try using prefix query? > > > > > > > > > > > > > Same results, apparently, when I use Luke 1.0.1. > > > > > > > > When I search for "Id:BAUER*" I get 15 hits in Luke, but in my > > > > custom app, zero. > > > > > > > > On Tue, Jun 26, 2012 at 12:31 PM, Rob Vesse > > > wrote: > > > > > > > > > You appear to be using Luke 3.5 which per the information on the > > > > > Luke homepage (http://code.google.com/p/luke/) uses Lucene 3.5 > > > > > > > > > > Since Lucene.Net is currently on 2.9.4 I wouldn't be surprised to > > > > > see different behavior between the API and executing in Luke. > > > > > > > > > > If you use a version of Luke which more closely aligns with the > > > > > version > > > > of > > > > > Lucene.Net (Luke 1.0.1 uses Lucene 3.0.1 which should be close > > > > > enough since the 2.9.x releases were previews of the 3.0.x > > > > > releases as I understood it) what behavior do you see? > > > > > > > > > > Hope this helps, > > > > > > > > > > Rob > > > > > > > > > > On 6/26/12 10:50 AM, "Rob Cecil" wrote: > > > > > > > > > > >If I run a query against my index using QueryParser to query a > > field: > > > > > > > > > > > > var query = _parser.Parse("Id:BAUER*"); > > > > > > var topDocs = searcher.Search(query, 10); > > > > > > Assert.AreEqual(count, topDocs.TotalHits); > > > > > > > > > > > >I get 0 for my TotalHits, yet in Luke, the same query phrase > > > > > >yields > > > > > >15 results, what am I doing wrong? I use the StandardAnalyzer > > > > > >both to create the index and to query. > > > > > > > > > > > >The field is defined as: > > > > > > > > > > > >new Field("Id", myObject.Id, Field.Store.YES, > > > > > >Field.Index.NOT_ANALYZED) > > > > > > > > > > > >and is a string field. The result set back from Luke looks like > > > > > >(screencap): > > > > > > > > > > > >http://screencast.com/t/NooMK2Rf > > > > > > > > > > > >Thanks! > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --e89a8f3b9beb9a0e5d04c366a5f1--