Re: How to show category count with results?

2007-07-31 Thread Shailendra Sharma
A better way is following: Cache the list of doc-ids for each category - you can cache this in a BitSet.. a bit at index doc-id is on if the category is present in document doc-id, else it is off. For user query, you need to calculate the BitSet, similar to above way. This can be done in a

RE: How to show category count with results?

2007-07-31 Thread Ard Schrijvers
Hello Shailendra, AFAICS you are reasoning from a static doc-id POV, while documents do not have a static doc-id in lucene. When you have a frequently updated index, you'll end up invalidating cached BitSet's (which as the number of categories and number of documents grow can absorb quite

Re: How to show category count with results?

2007-07-30 Thread Erick Erickson
You might want to search the mail archive for facets or faceted search (no quotes), as I *think* this might be relevant. Best Erick On 7/26/07, Ramana Jelda [EMAIL PROTECTED] wrote: Hi , Of course this statement is very expensive. --document.get(CAMPCATID)==null?:document.get(CAMPCATID);

RE: How to show category count with results?

2007-07-30 Thread Ard Schrijvers
Or check out Solr and see if you can use that, or see how they do it, Regards Ard You might want to search the mail archive for facets or faceted search (no quotes), as I *think* this might be relevant. Best Erick On 7/26/07, Ramana Jelda [EMAIL PROTECTED] wrote: Hi , Of

Re: How to show category count with results?

2007-07-30 Thread Dennis Kubes
We found that a fast way to do this simply by running a query for each category and getting the maxDocs. There would be one query for category getting a single hit. Dennis Kubes Erick Erickson wrote: You might want to search the mail archive for facets or faceted search (no quotes), as I

Re: How to show category count with results?

2007-07-30 Thread Dima May
Check this out: http://www.gossamer-threads.com/lists/lucene/java-user/35433?search_string=category;#35433 On 7/30/07, Dennis Kubes [EMAIL PROTECTED] wrote: We found that a fast way to do this simply by running a query for each category and getting the maxDocs. There would be one query for

RE: How to show category count with results?

2007-07-26 Thread Ramana Jelda
Hi , Of course this statement is very expensive. --document.get(CAMPCATID)==null?:document.get(CAMPCATID); Use StringIndex/FieldCache/something similar to implement category counting. :) Jelda -Original Message- From: Bhavin Pandya [mailto:[EMAIL PROTECTED] Sent: Thursday, July 26,