Hi Emir,

thank you, thats it.

But a question while reading the docs about sumTotalTermFreq from your link.
Example in the docs:
--------------------
If doc1:(fieldX:A B C) and doc2:(fieldX:A A A A):
...
freq(doc1, fieldX:A) = 4 (A appears 4 times in doc 2)


Shouldn't it be:
freq(doc2, fieldX:A) = 4 (A appears 4 times in doc 2)

Because the "freq" of _doc2_ and not _doc1_ for fieldX:A is 4?
A typo in the docs?


Regards
Bernd


Am 21.12.2017 um 09:53 schrieb Emir Arnautović:
> 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
> 
> 

-- 
*************************************************************
Bernd Fehling                    Bielefeld University Library
Dipl.-Inform. (FH)                LibTec - Library Technology
Universitätsstr. 25                  and Knowledge Management
33615 Bielefeld
Tel. +49 521 106-4060       bernd.fehling(at)uni-bielefeld.de

BASE - Bielefeld Academic Search Engine - www.base-search.net
*************************************************************

Reply via email to