You will likely find this thread interesting...

http://www.nabble.com/Announcement%3A-Lucene-powering-CNET.com-Product-Category-Listings-t266441.html

: 1) Do queries for each sub-category using the results of the first initial
: query and use the hits count to select the sub-categories to display, but I
: might have thousands of sub-categories and it would be too slow..

The key is not to repeat the query for every sub-cat with an added clause,
it's to do the query once using a HitCollector that generates a BitSet of
all matching results, and then intersect that with BitSets returned by
Filter's (or other HitCollectors) that you've used to get a list of *all*
results in each sub-cat.

why is this faster? you ask .. because only the initial query changes on
each user search -- the set of all documents in a sub-cat doesn't change
untill new documents are added or deleted, so they can be cached (either
manually, or using CachingWrappingFIlter) ... doing a few thousand BitSet
intersections doesn't take as much time as you think.




-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to