[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lucene-user
Subject:    Re: Fast access to a random page of the search results.
From:       "Stanislav Jordanov" <stenly () sirma ! bg>
Date:       2005-03-02 10:35:31
Message-ID: 003101c51f13$8f6640d0$d380a8c0 () sirma ! int
[Download RAW message or body]

You're rihgt:  nHits - nHits == 0 :)
But I did the right tests - it just happened that I've sent you a wrong
source.
I mean I performed the tests accessing the proper last doc: doc(nHits - 1)
then I switched to accessing the first hit, just to make sure (once again)
there is essential difference in access times.
And instead of wiping out the code fragment (nHits - 1) and replacing it
with 0, a replaced 1 with nHits.
That's how the resulting (nHits - nHits) code got posted.

Yes, the index is stored at a local hard drive.

Stenly



----- Original Message ----- 
From: "Doug Cutting" <cutting@apache.org>
To: "Lucene Users List" <lucene-user@jakarta.apache.org>
Sent: Tuesday, March 01, 2005 8:15 PM
Subject: Re: Fast access to a random page of the search results.


> Stanislav Jordanov wrote:
> >                 startTs = System.currentTimeMillis();
> >                 dummyMethod(hits.doc(nHits - nHits));
> >                 stopTs = System.currentTimeMillis();
> >                 System.out.println("Last doc accessed in " + (stopTs -
> > startTs)
> >                                     + "ms");
>
> 'nHits - nHits' always equals zero.  So you're actually printing the
> first document, not the last.  The last document would be accessed with
> 'hits.doc(nHits)'.  Accessing the last document should not be much
> slower (or faster) than accessing the first.
>
> 200+ milliseconds to access a document does seem slow.  Where is you
> index stored?  On a local hard drive?
>
> Doug
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>


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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic