On May 22, 2007, at 9:58 AM, [EMAIL PROTECTED] wrote:
I use Solr to search through a set of about 200,000 documents. Each document has a numeric ID. How to do the following:

1) I use facets and want to return the facets for "all documents" as the starting point of the user interface. In other words, I want to /select the facet counts for about 10 facets (like states for example) for all documents without having to do a search. Is this possible?

Use a query of *:*, with rows=0 to get a list of all the facets across the entire index.

2) Each document will be shown to the user with a check box next to it. I want to user to be able to select certain documents and "save" their ids some where else. This is not a problem. However, I also want to give the user an ability to say "Select All Documents". This would need to save the ids of ALL documents found with user's given query and query filter (based on the facets that they selected). This list could potentially contain over 10,000 documents. Question: How to easily and quickly grab the IDs of all these documents?

Yikes! Perhaps save by query instead of as a list of id's, as long as the user would expect that any new documents would also be in their saved list.

If you must get the ids though, you could get a list of all of the ids by doing a *:* query, only returning the id field.

3) Once the user saves the list, I want them to be able to do further searches by do a "negative union" with the set of ids they already saved. So for example, if they already saved 1000 ids into one of their lists, they would need to be able to get results from Solr that match their query but are NOT in the set of 1000 ids that they already saved. Is this possible?

It's possible. You could construct a filter query with "-id:001 -id: 002 ...". I'm not sure how happy the query parser would be with that enormous of an expression, but you could also split them up into multiple filter queries. There may be other caveats to these approaches that I've overlooked though.

        Erik

Reply via email to