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 when I debug simplefacet. It always iterates over all the
documents in the result docset (SimpleFacet.getFieldCacheCounts line 259).
But if this is the only way, then ok.
Thnx
Thijs
Ryan McKinley wrote:
On Apr 27, 2008, at 7:50 AM, Thijs Vonk wrote:
What is the best way to get the unique terms from a field in a result?
I've been using SimpleFacet to do this. However, I don't need the
counts, so it seems overkill to have to iterate over all the result
documents per field to get the unique values for that field.
The field's contain database Id's that I use on the client side to
get aditional information from the database.
Is there a faster way to get the unique values from a field in a result?
If you are looking for the unique terms for a field across all
documents, faceting is the way to go. The counts are stored in the
index, so i don't think that is a substantial loss.
If you are looking for the unique terms within a document (I doubt you
are, but not totally clear from your question) perhaps you could store
the unique terms?
ryan