I hope you're not using the Hits object to assemble all 14M results. A
recurring theme is that a Hits object should NOT be used for collection more
than a few (100 I think) objects since it re-executes the query every 100 or
so terms it returns. It's intent is to efficiently return the first few
hits.

Look at HitCollector of you want to examine lots of results.

Of course this doesn't apply if you are just using the Hits object to see
how many documents matched and NOT looping through all them.

Why does the second query take so little time? Two things suggest
themselves.
1> if your first query is the first query after opening the index, there's
significant overhead involved that you pay when opening the index, and the
second time you won't pay it.
2> If you're issuing the same query twice, there is probably some cache
involved.

It would probably be instructive to issue a second query that is NOT the
same as the first (using the same searcher) and see the response time. That
way you could gain some insight into whether the time differential is due to
opening the index.

Best
Erick

Reply via email to