Hello, We are looking at a couple of options for using solr to dynamically calulate unique values per field. In testing out Solr 5.1, I've been using the unique() facet function:
http://yonik.com/solr-facet-functions/ Overall, loving the JSON Facet API, especially the sub-faceting thus far. Here's my two part question: I. When I use the unique aggregation function on a "string" field (uniqueValues:'unique(myStringField)'), it works as expected, returns the number of unique fields. However when I pass in an int -- or date -- field (uniqueValues:'unique(myIntField)') the resulting count is 0. The cause might be something else, but if it can be replicated by another user, would be great to discuss the unique function further -- in our current use-case, we have a field where under 20 unique values are present but the values are ints. II. Is there a way to use the stats.calcdistinct functionality and only return the countDistinct portion of the response and not the full list of distinct values -- as provided in the distinctValues portion of the response. In a field with high cardinality the response size becomes too large. If there is no such option, could someone point me in the right direction for implementing a custom solution? Thank you for your time, Levan -- View this message in context: http://lucene.472066.n3.nabble.com/5-1-unique-facet-function-calcDistinct-tp4200110.html Sent from the Solr - User mailing list archive at Nabble.com.