Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 12593 invoked from network); 22 Dec 2009 12:30:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Dec 2009 12:30:29 -0000 Received: (qmail 92383 invoked by uid 500); 22 Dec 2009 12:30:27 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 92337 invoked by uid 500); 22 Dec 2009 12:30:27 -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 92327 invoked by uid 99); 22 Dec 2009 12:30:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Dec 2009 12:30:27 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [85.25.71.29] (HELO mail.troja.net) (85.25.71.29) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Dec 2009 12:30:15 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.troja.net (Postfix) with ESMTP id 5C295D3600D for ; Tue, 22 Dec 2009 13:29:51 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.troja.net Received: from mail.troja.net ([127.0.0.1]) by localhost (megaira.troja.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oJXljhZPV6ni for ; Tue, 22 Dec 2009 13:29:41 +0100 (CET) Received: from VEGA (port-83-236-62-54.dynamic.qsc.de [83.236.62.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.troja.net (Postfix) with ESMTPSA id 41160D36002 for ; Tue, 22 Dec 2009 13:29:41 +0100 (CET) thread-index: AcqC/ymew8GwaS67SrSJmCiIYUPFxgAAzqYA From: "Uwe Schindler" To: References: <9a76536b0912210426x7ad12c4aub6457de5750c7221@mail.gmail.com> <8c4e68610912210751pd2f602fn71f2447b3ebeafc7@mail.gmail.com> <9a76536b0912220405i295390f2j94bbf482a957467f@mail.gmail.com> Subject: RE: Lucene' results paging Date: Tue, 22 Dec 2009 13:29:41 +0100 Message-ID: <70374D82CB7843279AF1181DBB652191@VEGA> MIME-Version: 1.0 Content-Type: text/plain; charset="KOI8-R" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <9a76536b0912220405i295390f2j94bbf482a957467f@mail.gmail.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Ist inside TopDocs class as a getter method. ----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: uwe@thetaphi.de > -----Original Message----- > From: =E1=CE=D4=CF=CE =EB=C9=D2=C9=CC=CC=CF=D7 = [mailto:antonv.kirillov@gmail.com] > Sent: Tuesday, December 22, 2009 1:05 PM > To: java-user@lucene.apache.org > Subject: Re: Lucene' results paging >=20 > Thanks for your answer. But how should I get the total nubmer of > search results in this case? >=20 > On Mon, Dec 21, 2009 at 6:51 PM, Ian Lea wrote: > > Hi > > > > > > The standard approach to paging is just to do the search again and > > pick out the docs you want, along the lines you outline. =9AYou = cannot > > pass start/end info to any search methods. > > > > When you set max doc to, say, 10, lucene will find the 10 highest > > scoring docs and return them. =9AThere is no point in passing a = number > > higher than you need. =9ASo if you are displaying 10 hits per page, = call > > search(query, 10) for the first page, ..., 20 for the second and = pick > > out the last 10, and so on. > > > > An alternative approach is for you to cache the search results > > yourself. =9AThat way you can avoid any subsequent searches. =9ABut = that > > has it's own overhead and complexity, and most people most of the = time > > don't get much past the first page. > > > > > > http://wiki.apache.org/lucene- > = java/LuceneFAQ#How_do_I_implement_paging.2C_i.e._showing_result_from_1- > 10.2C_11-20_etc.3F > > > > -- > > Ian. > > > > > > On Mon, Dec 21, 2009 at 12:26 PM, =E1=CE=D4=CF=CE = =EB=C9=D2=C9=CC=CC=CF=D7 > > wrote: > >> Hi, All! I have some problems with Lucene's search process and it's > >> results, so I hope You could help me. > >> > >> First one: how should I split results by pages? Now I get search > >> results in such way: > >> > >> TopDocs topDocs =3D is.search(finalQuery, 100000) //For example > >> > >> and after that I get the needed results in such way: > >> > >> //for example startPage =3D 20, endPage =3D 40 > >> for(int j=3DstartPage; j >> > >> doc[j-startPage] =3D is.doc(topDocs.scoreDocs[j].doc); > >> } > >> > >> I think this is a bad approach. How should I optimize my code to = make > >> search faster? Is there any possibility to set start and stop pages = in > >> search methods? > >> > >> The second one: > >> After the search is completed and the results are not sorted are = all > >> the results stored in search engine? I mean when I set the max = number > >> of docs in method search(finalQuery, 10) equal 10. would Lucene = find > >> all relevant docs, then sort them by relevance and select first ten > >> after that? Or does Lucene store some specific information in = indices > >> which allows select first 10 most relevant docs without sorting all > >> million (for example) relevant pages? > >> > >> Thanks in advance. > >> -- > >> Anton Kirillov > >> > >> = --------------------------------------------------------------------- > >> 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 > > > > >=20 >=20 >=20 > -- > =F3 =D5=D7=C1=D6=C5=CE=C9=C5=CD, =EB=C9=D2=C9=CC=CC=CF=D7 = =E1=CE=D4=CF=CE >=20 > --------------------------------------------------------------------- > 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