On 6/29/2017 8:40 AM, Kaushik wrote: > We are trying to get the most frequently used words in a collection. > My understanding is that using facet.field=content_txt. An e.g. of > content_txt value is "The fox jumped over another fox". In such a > scenario, I am expecting the facet to return with "fox" and with a > count value of 2. However, we end up getting "fox" with a value of 1. > It appears we are getting total number of documents that match the > query as opposed to the total number of times the word ocurred. How > can the latter be achieved?
Facets count the number of documents, not the number of terms. You might be after the terms component. https://lucene.apache.org/solr/guide/6_6/the-terms-component.html This generally works across the entire index, while facets can operate on documents that match a query. Thanks, Shawn