Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 19824 invoked from network); 26 Nov 2009 09:40:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 Nov 2009 09:40:01 -0000 Received: (qmail 74379 invoked by uid 500); 26 Nov 2009 09:39:58 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 74291 invoked by uid 500); 26 Nov 2009 09:39: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 74281 invoked by uid 99); 26 Nov 2009 09:39:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Nov 2009 09:39:58 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [203.104.17.143] (HELO web94803.mail.in2.yahoo.com) (203.104.17.143) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 26 Nov 2009 09:39:52 +0000 Received: (qmail 70950 invoked by uid 60001); 26 Nov 2009 09:39:29 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1259228368; bh=xUgOnfswzZJkgfrkRcGhv/CM0/9X/YZlNeX+IWVP3m8=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=g3NTxd4q5Z+uUrVoTt/XZa3yHlG7i3gew3cO03Lla2ae+Y+IoMO90eEIRTtCee5VAYpf9vl0VW8+i6vpdbt48DywEHUI01Nr6oBeFpdSSTSdMNQmA9gMVV0Zy7oXYTWdDHL6jKULIwASjgMo16GsOtxEQroutXab1W7i9bwt1Tc= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=kSM0Fo5j9qV23J55KDfwP4yK774HSmqjDOdVSIUr7mG4I0y3+h/mlmfXV/VsCrfqXn2SFkUaiHJI5qf2/KFP+Wtr534tzhGXAsy/KQHw2NtevkwaHufccUlGaVtVoU11Lo7w+Xl9opxwt6UObdbnByqhkr/ro3IEMKHE2UoW4rg=; Message-ID: <900164.70889.qm@web94803.mail.in2.yahoo.com> X-YMail-OSG: 1Kf6LlwVM1m6_6XN9dCR3ZppU0tTyJMg_PMXbcGXiVzRU7jvVg1R98i5vfGXqxkKAPs1vm6Y8IEiKR84S6tJWqmzxKjhJ1vq_T8U3OXSeDXCvb0Q36EDwfK5_b85UhnTbkhQZXUQk5ZKnNNrNaXEViIaiRyHIfpnXXWdmTB0q8h_P3FULCxe4DhQiDVqlNlUoO8lJeFUFKgSgsmLvVL8VoM4ihRM.zqb.PQ_cPyxrFJRhMNfYWRLwMBrebsaqfjm02TWpzSb Received: from [209.73.190.210] by web94803.mail.in2.yahoo.com via HTTP; Thu, 26 Nov 2009 15:09:28 IST X-Mailer: YahooMailClassic/8.1.6 YahooMailWebService/0.8.100.260964 Date: Thu, 26 Nov 2009 15:09:28 +0530 (IST) From: DHIVYA M Subject: RE: Need help regarding implementation of autosuggest using jquery To: java-user@lucene.apache.org In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-500321030-1259228368=:70889" --0-500321030-1259228368=:70889 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Sir, =A0 Your suggestion was fantastic. =A0 I tried the below mentioned code but it is showing me the entire result of = indexed words starting from the letter that i give as input. Ex: if i give "fo" am getting all the indexes from the word starting with fo upto words starti= ng with z. i.e. it starts displaying from the word matching the search word and ends u= p with the last word available in the index file. =A0 Kindly suggest me a solution for this problem =A0 Thanks in advance, Dhivya --- On Wed, 25/11/09, Uwe Schindler wrote: From: Uwe Schindler Subject: RE: Need help regarding implementation of autosuggest using jquery To: java-user@lucene.apache.org Date: Wednesday, 25 November, 2009, 9:54 AM Hi Dhivya, you can iterate all terms in the index using a TermEnum, that can be retrieved using IndexReader.terms(Term startTerm). If you are interested in all terms from a specific field, position the TermEnum on the first possible term in this field ("") and iterate until th= e field name changes. As terms in the TermEnum are first ordered by field nam= e then by term text (in UTF-16 order), the loop would look like this: IndexReader reader =3D ... String field =3D .... Field =3D field.intern(); // important for the while loop TermEnum tenum =3D reader.terms(new Term(field,"")); try { =A0=A0=A0 do { =A0=A0=A0 =A0=A0=A0 final Term term =3D tenum.term(); =A0=A0=A0 =A0=A0=A0 if (term=3D=3Dnull || term.field()!=3Dfield) break; =A0=A0=A0 =A0=A0=A0 final String termText =3D term.text(); =A0=A0=A0 =A0=A0=A0 // do something with the termText =A0=A0=A0 } while (tenum.next()); } finally { =A0=A0=A0 tenum.close(); } ----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: uwe@thetaphi.de > -----Original Message----- > From: DHIVYA M [mailto:dhivyakrishnan87@yahoo.com] > Sent: Wednesday, November 25, 2009 8:06 AM > To: java user > Subject: Need help regarding implementation of autosuggest using jquery >=20 > Hi all, >=20 > Am using lucene 2.3.2 as a search engine in my e-paper site. So that i > want the user to search the news. I achieved that objective but now am > trying to implement autosuggest so that user can pick a choice from the > drop down and no need of typing in the entire sentence or so. >=20 > I have download Jquery for this purpose=A0and am trying to implement it. > The collections of data to refer for the suggestion is given in an > arraylist or jus with in a string. >=20 > But for my application, i need to populate the suggestions with the > indexed words available in the index file created during indexing > operation. >=20 > Can anyone give an idea to read the contents from the index file and make > it available as suggestions? or anyother idea to achieve this objective? >=20 > Thanks in advance, > Dhivya >=20 >=20 >=A0 =A0 =A0=A0=A0The INTERNET now has a personality. YOURS! See your Yahoo= ! Homepage. > http://in.yahoo.com/ --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org =0A=0A=0A The INTERNET now has a personality. YOURS! See your Yahoo! H= omepage. http://in.yahoo.com/ --0-500321030-1259228368=:70889--