lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: Search Help
Date Thu, 10 Nov 2005 23:33:55 GMT

: That's what I'm doing now, but I was thinking that if I limit the number of
: results I get back, I can save query time.  Maybe I'm wrong?

one thing that does slightly bug me about the way the Hits class works, is
that the constructor (which is called by the calls
getMoreDocs(50) ... which ensures that the first 100 results are
cached beore the client has ever said how many results they are
interested in.  Each call to Hits.doc(x) calls getMoreDocs(x) if x is
bigger then the largest doc fetched into the cache.

In the past, Another user asked a question regarding the equivilent of
paginated searching, where his "pages" had a large number of results (1000
i think) and he was wondering why on page two, both the call to search,
and the call to Hits.doc(1001) were taking so long -- it's because the
call to search was fetching the first 100 docs, and then the call to
Hits.get(1001) was throwing away that info and getting a bunch more.

Your situation isn't exactly the same, but it is relatd in the sense that
by using Hits, you are getting some under the covers behavior that is
targeted at the "common case" and you are not the common case.

If you acctaully feel like your performance isn't good enough, and you
want to make your code a little more complicated, and start playing
with the "Expert" methods, you might want to take a look at this one...,,%20int)


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message