Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 30521 invoked from network); 8 Jun 2007 15:51:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Jun 2007 15:51:31 -0000 Received: (qmail 81127 invoked by uid 500); 8 Jun 2007 15:51:27 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 81090 invoked by uid 500); 8 Jun 2007 15:51:26 -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 81079 invoked by uid 99); 8 Jun 2007 15:51:26 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jun 2007 08:51:26 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [212.27.42.28] (HELO smtp2-g19.free.fr) (212.27.42.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jun 2007 08:51:21 -0700 Received: from [192.168.1.102] (dau94-4-82-227-122-98.fbx.proxad.net [82.227.122.98]) by smtp2-g19.free.fr (Postfix) with ESMTP id 9CACC99005 for ; Fri, 8 Jun 2007 17:50:59 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v752.2) In-Reply-To: <4669521F.7050101@usherbrooke.ca> References: <6e3ae6310706071831s6e2b239as77bcbbc39e47548f@mail.gmail.com> <4669521F.7050101@usherbrooke.ca> Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Message-Id: <30B18185-E382-4DF7-A0A1-FA3AD811F7EE@garambrogne.net> Content-Transfer-Encoding: quoted-printable X-Image-Url: http://homepage.mac.com/rdupond/.cv/thumbs/me.thumbnail From: Mathieu Lecarme Subject: Re: How to implement AJAX search~Lucene Search part? Date: Fri, 8 Jun 2007 17:50:58 +0200 To: java-user@lucene.apache.org X-Mailer: Apple Mail (2.752.2) X-Virus-Checked: Checked by ClamAV on apache.org If you do that, you enumerate every terms!!! If you use a alphabeticaly sorted collection, you can stop, when =20 match stop, but, you have to test every terms before matching. Lucene gives you tools to match begining of a term, just use it!! M. Le 8 juin 07 =E0 14:57, Patrick Turcotte a =E9crit : > Hi, > > What we did was this: > > 1) When you application starts, it scans the index for terms values =20= > and > store them in a map or something. > > 2) When you receive "ajax requests", you compare with the map data and > return the relevant part. Works quite fast for us, without round trips > to Lucene. > > Patrick > > Chris Lu wrote: >> Hi, >> >> I would like to implement an AJAX search. Basically when user =20 >> types in >> several characters, I will try to search the Lucene index and found >> all possible matching items. >> >> Seems I need to use wildcard query like "test*" to matching anything. >> Is this the only way to do it? It doesn't seems quite efficient, >> especially when you just typed in the first character. >> >> I guess the "good" way is to go through the terms, and return as soon >> as, for example, 10 terms are found. >> >> I am wondering is there anything like this already built? >> > > > --=20 > Patrick Turcotte > Analyste > Projet Franqus : http://franqus.usherbrooke.ca > ---------------------------------------------- > patrick.turcotte@USherbrooke.ca > (819) 821-8000, poste 63234 > 1-800-267-8337 puis 63234 > > > --------------------------------------------------------------------- > 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