Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 58295 invoked from network); 22 Apr 2009 12:45:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Apr 2009 12:45:00 -0000 Received: (qmail 97026 invoked by uid 500); 22 Apr 2009 12:44:58 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 96962 invoked by uid 500); 22 Apr 2009 12:44:58 -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 96952 invoked by uid 99); 22 Apr 2009 12:44:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Apr 2009 12:44:58 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of erickerickson@gmail.com designates 209.85.221.136 as permitted sender) Received: from [209.85.221.136] (HELO mail-qy0-f136.google.com) (209.85.221.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Apr 2009 12:44:49 +0000 Received: by qyk42 with SMTP id 42so4287159qyk.29 for ; Wed, 22 Apr 2009 05:44:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=F5jphWyUhTRydT8gFuE6IdUh8hhYaMTBauPgL018LYA=; b=EXWHllEZACCMEwYHTE94mql4q4Gipd9kk2mjaLWOMCEZile9YFxooxSdwHON4Ziaes yAug/pCCVlbS8369EENqpjTDOjqO/Gc3sWsxk0VxYpbuTmeTLD+w/zGdrM397a2u8GuO wle/XznmXHhQ/yOJarSMT0nKRXNlP5gu6iTKI= 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=CxU78sD3pr/bfBysiJNruetE4echpJddSEIHP7+eDuS2RkvptYpQyLMy3onljxJ0yt KdcQ8PN2ftxA/gxOibb++QGwwaeh05rbcBf38yXSgr1+mbTiE8AKqHGoxqWO87PFc9B7 zeVZoHvJYTtJPIC5t1bvFu64WttVjng1+1nWc= MIME-Version: 1.0 Received: by 10.220.45.131 with SMTP id e3mr11034656vcf.89.1240404269008; Wed, 22 Apr 2009 05:44:29 -0700 (PDT) In-Reply-To: References: Date: Wed, 22 Apr 2009 08:44:28 -0400 Message-ID: <359a92830904220544o7e5f0c4bv1de9ad799d7ad3bb@mail.gmail.com> Subject: Re: Appropriate analyzer From: Erick Erickson To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary=0016e6470526d50a490468241fac X-Virus-Checked: Checked by ClamAV on apache.org --0016e6470526d50a490468241fac Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit *If* your terms are simple (that is, not wildcarded), you may get some joy from TermEnum. The idea here would be to find the longest term *already in your index* that satisfies your need and use that to form a simple TermQuery.... Essentially using TernEnum.skipTo on successively shorter strings until it returned true... Best Erick On Tue, Apr 21, 2009 at 4:57 PM, Artyom Sokolov wrote: > Hello. > > Currently I'm trying to find something like an analyzer to solve the > problem. > > Actually, what I need is next: search on a query string step-by-step, > trimming last char on each step. Small example: > > In index we've: abc, abcdef, xyz > When search on abcdefgh the most relevant result should be abcdef, while > searching on abcde the best one is abc. > > Thanks. > > Sincerely, > Artyom Sokolov > --0016e6470526d50a490468241fac--