The documents in my index will contain a "category" field. (We can assume that the number of possible categories will be small - 10 or so max - and that they'll be known in advance.) I need to be able to present the search results to the end user like this:

- top 10 results in category "x":
        1. sdfsdfsd
        2. dfgdgfdfg
        3. [...]
- top 10 results in category "y":
        1. gffgdgf
        2. kjhjkkghj
[...]

The first thing I thought of was to construct a boolean AND query for every possible category (from the user's query and a term query for the category); but this seems like it might be causing a lot of redundant work. My next idea was to create a QueryFilter from the user's query, and run a search for each category with this filter and a term query. Since the QueryFilter is supposed to cache results, this should theoretically be more efficient. So my questions to the Lucene gurus are:

1) Will the QueryFilter method really be more efficient?

2) Is there yet another way to accomplish what I need?

-MB


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

Reply via email to