I am writing a request handler for SOLR 4.0 and i am trying to get all unique values of a field of type tlong
(field is indexed of course).
Whenever i try to get all unique terms for a tstring field i can simply use the following code:
DocTermsIndex sourceIndex=FieldCache.DEFAULT.getTermsIndex(searcher.getAtomicReader(), "txtField")
TermsEnum terms=sourceIndex.getTermsEnum()
Then i can iterate over all unique terms, execute utf8ToString()
on every term and it is working fine.
When i try to do the same for a tlong
field i get garbled results - number of terms returned is different from the number of unique values and the values themselves do not represent Long
in any way (different value lengths etc..).
Is there another way of obtaining a list of unique values for a tlong
field?