Return-Path: X-Original-To: apmail-lucene-java-user-archive@www.apache.org Delivered-To: apmail-lucene-java-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 6BE57DE88 for ; Wed, 4 Jul 2012 20:20:51 +0000 (UTC) Received: (qmail 61355 invoked by uid 500); 4 Jul 2012 20:20:49 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 61271 invoked by uid 500); 4 Jul 2012 20:20:49 -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 61262 invoked by uid 99); 4 Jul 2012 20:20:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Jul 2012 20:20:49 +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 (nike.apache.org: domain of hiren.t.shah@gmail.com designates 209.85.161.176 as permitted sender) Received: from [209.85.161.176] (HELO mail-gg0-f176.google.com) (209.85.161.176) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Jul 2012 20:20:43 +0000 Received: by ggnk4 with SMTP id k4so7796011ggn.35 for ; Wed, 04 Jul 2012 13:20:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=UzCGIOcuV9SkJXe/ZprVIDvMhQLwls5rFP5IXAvIPAs=; b=Xw66Qhs2yqXWkF264OhoG6gtC0JzhSDtc+SQS436cRTRNIOaJgfa3WShmX4hVUl1K9 yCsLQYAcVexugYiraDectdReyxicbdU/S6sNwAfbiW+68OIprgHdmgHocsxfrTuY8ptB WsLBPaBIKd091uEKDv8mCi66FO7gbNHy0ZmxIdO85PhUREvdFyyIePhdbUACaVWTkV8J bd3VHnNcqUrbjwucsnJjI1pzTPCkuZCxRVZRgRetuXFn1BLbkKom3p7LyplR0WT2WIno DgU1FQhiZJeKLbCGNJqFMyBFxcRe9Rrjxh9MdNhzFbaqGbjfsOOzlM4Ae42T4Uy69Agv tQjg== MIME-Version: 1.0 Received: by 10.50.159.135 with SMTP id xc7mr12660256igb.9.1341433221222; Wed, 04 Jul 2012 13:20:21 -0700 (PDT) Received: by 10.64.107.5 with HTTP; Wed, 4 Jul 2012 13:20:21 -0700 (PDT) In-Reply-To: References: Date: Thu, 5 Jul 2012 01:50:21 +0530 Message-ID: Subject: Re: Starts with Query - Return like search From: Hiren Shah To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary=14dae9399de1a4100d04c406c2a5 --14dae9399de1a4100d04c406c2a5 Content-Type: text/plain; charset=ISO-8859-1 Hi Jack This needs to be taken care while indexing?Where can i get the code for the edgegram indexing and then searching.? -Hiren On Wed, Jul 4, 2012 at 9:19 PM, Jack Krupansky wrote: > You might also consider using the EdgeNGram filter for your documents > since it would index "bar" as both "ba" and "bar" at the same position, > eliminating the need for the use of wildcards. It makes the index bigger, > but eliminates the performance degradation of wildcards. It isn't great for > all situations, but maybe it would work well for your case. > > -- Jack Krupansky > > -----Original Message----- From: Ian Lea > Sent: Wednesday, July 04, 2012 4:00 AM > To: java-user@lucene.apache.org > Subject: Re: Starts with Query - Return like search > > > In fact there is an FAQ entry Can I combine wildcard and phrase > search, e.g. "foo ba*"? at > http://wiki.apache.org/lucene-**java/LuceneFAQ#Can_I_combine_** > wildcard_and_phrase_search.2C_**e.g._.22foo_ba.2A.22.3F > which suggests you extend the QueryParser to build a MultiPhraseQuery. > There's also ComplexPhraseQueryParser which looks interesting. > > > -- > Ian. > > > On Wed, Jul 4, 2012 at 9:51 AM, Ian Lea wrote: > >> Where exactly are you using these double quoted strings? QueryParser? >> It would help if you showed a code snippet. >> >> Assuming your real data is more complex and the strings you are >> searching for aren't necessarily at the start of the text, you'll need >> some mix of wildcard and proximity searching. I don't think that "foo >> ba*"~n >> will work but I'm sure you'll be able to do it with a SpanQuery or >> six. SpanNearQuery lets you specify slop and whether you care if >> matches are in order or not. >> >> See http://www.lucidimagination.**com/blog/2009/07/18/the-**spanquery/for >> info on spans. >> >> See also http://wiki.apache.org/lucene-**java/LuceneFAQ#Why_am_I_** >> getting_no_hits_.2BAC8_**incorrect_hits.3F >> for good tips on figuring out why things aren't doing what you want. >> >> Good luck. >> >> >> -- >> Ian. >> >> >> On Wed, Jul 4, 2012 at 7:11 AM, Hiren Shah >> wrote: >> >>> I have used standardAnalyser to save the ANALYZED data in index. >>> >>> Data is as below:- >>> >>> 1. foo bag test >>> 2. foo bar test >>> 3. bar india foo >>> >>> >>> I used >>> When i search using---------------> foo ba >>> I get all results when i use ------->(+foo* +ba*) >>> >>> 1. I tried using "foo ba" (with double quotes) but no results come as >>> it searches for exact word >>> 2. I tried using "foo ba*" (with double quotes) but no results come >>> as >>> it searches for exact word >>> 3. I tried using "foo bar" (with double quotes) Then 2nd result comes >>> as both words are completed >>> >>> What should be done to get options 1 and 2 in results when user types >>> foo >>> ba*. I dont want 3rd result but want 1st 2 results. >>> Please help. >>> >>> Thanks >>> Hiren >>> >> > ------------------------------**------------------------------**--------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.**apache.org > For additional commands, e-mail: java-user-help@lucene.apache.**org > > ------------------------------**------------------------------**--------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.**apache.org > For additional commands, e-mail: java-user-help@lucene.apache.**org > > --14dae9399de1a4100d04c406c2a5--