You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Marcus Falck <ma...@observer.se> on 2006/09/01 10:10:58 UTC

SV: GetMoreDocs question

Thx Hoss.

But why do I have to reterive atleast 1 document when im using the TopDocs ?
(If I set nDoc to 0 it will throw an exception).

/
Marcus

-----Ursprungligt meddelande-----
Från: Chris Hostetter [mailto:hossman_lucene@fucit.org] 
Skickat: den 31 augusti 2006 20:09
Till: java-user@lucene.apache.org
Ämne: Re: GetMoreDocs question


: I have some questions regarding the GetMoreDocs(50) call in the
: constructors of the Hits class.

: First off whats the purposes of this call?

Hits is designed to meet the simple needs of simple clients -- the
assumption is that clients using Hits want simple paginated results - so
Hits goes ahead and gets you page#1.

: Can I do something so I don't cache up 100 docs when I'm just asking for
: a count?

This is what the search method that returns TopDocs is designed for --
when all you care about is the totalHits and the first N docs (in your
case N is 0 or maybe 1)



-Hoss


---------------------------------------------------------------------
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


Re: SV: GetMoreDocs question

Posted by Chris Hostetter <ho...@fucit.org>.
: But why do I have to reterive atleast 1 document when im using the TopDocs ?
: (If I set nDoc to 0 it will throw an exception).

i didn't say you had to, i just saaid "maybe" ... i don't know whatthe
behavior is if you use 0 -- ideally it would work fine, but in practice i
do't know if anyone has ever tested that case.

:
: /
: Marcus
:
: -----Ursprungligt meddelande-----
: Från: Chris Hostetter [mailto:hossman_lucene@fucit.org]
: Skickat: den 31 augusti 2006 20:09
: Till: java-user@lucene.apache.org
: Ämne: Re: GetMoreDocs question
:
:
: : I have some questions regarding the GetMoreDocs(50) call in the
: : constructors of the Hits class.
:
: : First off whats the purposes of this call?
:
: Hits is designed to meet the simple needs of simple clients -- the
: assumption is that clients using Hits want simple paginated results - so
: Hits goes ahead and gets you page#1.
:
: : Can I do something so I don't cache up 100 docs when I'm just asking for
: : a count?
:
: This is what the search method that returns TopDocs is designed for --
: when all you care about is the totalHits and the first N docs (in your
: case N is 0 or maybe 1)
:
:
:
: -Hoss
:
:
: ---------------------------------------------------------------------
: 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
:



-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org