HI Bernd, It seems to me that you are looking for sumTotalTermFreq function. https://lucene.apache.org/solr/guide/6_6/function-queries.html <https://lucene.apache.org/solr/guide/6_6/function-queries.html>
HTH, Emir -- Monitoring - Log Management - Alerting - Anomaly Detection Solr & Elasticsearch Consulting Support Training - http://sematext.com/ > On 21 Dec 2017, at 09:23, Bernd Fehling <bernd.fehl...@uni-bielefeld.de> > wrote: > > Hi list, > > actually a simple question, but somehow i can't figure out how to get > the total number of terms in a field in the index, example: > > record_1: fruit: apple, banana, cherry > record_2: fruit: apple, pineapple, cherry > record_3: fruit: kiwi, pineapple > record_4: fruit: > > - a search for fruit:* gives 3 results (just a search) > - the number of unique terms for fruit is 5 (reported by luke) > - the number of term apple is 2 (reported by luke) > - the number of terms for fruit of record_1 and record_2 is 3 and > for record_3 is 2 > > But how to get the number of all terms for fruit of all records which should > be 8? > > I'm talking about 100 Million records, the 4 above are just an example. > This is not a general use case, more for statistical purposes. > > Regards > Bernd