: You are correct I'm looking for the unique values for one field in a DocSet. : The field is not multivalued. and it contains only 1 long value, the pk of a : database table : But you said the counts are stored in the index, I don't see that. Because
there's something very confusing about your question ... if the value of the field is unique for every document (by "pk" you mean the primary key for these docs in your database correct?) then why do you specificly need the "unique terms" ? ... aren't they by definition unique? usually when people ask questions like this, they are interested in the "unique values" for something like a "category" field, where lots of documenst are in the same category, and they want to know what the full list of categories is for all ofhte documenst that match their query. if you want the list of all "primary keys" for all the documents that match your query, why not just make sure that field has stored="true" in the schema.xml and getthe values that way? I'm extra confused because of this comment... : when I debug simplefacet. It always iterates over all the documents in the : result docset (SimpleFacet.getFieldCacheCounts line 259). it doesn't *seem* like faceting is neccessary, but why do you think iterating over all the documents in your result set set seems like a waste here? if you want to know what *all* the values are for every document in your doc set, then regardless of wether the values are distinct for each doc, how else could Solr get all the values then looking at each matching doc? -Hoss