In Solr 5.0+ you can use Lucene's DocValues API to read the indexed
information. This is a unifying API over field cache and doc values so it
can be used on all indexed fields.

e.g. for single-valued field use
searcher.getLeafReader().getSortedDocValues(fieldName);
and for multi-valued fields
use searcher.getLeafReader().getSortedSetDocValues(fieldName);

On Wed, May 13, 2015 at 11:11 AM, Parvesh Garg <parv...@zettata.com> wrote:

> Hi All,
>
> Was wondering if there is any class in Solr that provides utility methods
> to fetch indexed field values for documents using docId. Something simple
> like
>
> getMultiLong(String field, int docId)
>
> getLong(String field, int docId)
>
> We have written a solr component to return group level stats like avg
> score, max score etc over a large number of documents (say 5000+) against a
> query executed using edismax. Need to get the group id fields value to do
> that, this is a single valued long field.
>
> This component also looks at one more field that is a multivalued long
> field for each document and compute a score based on frequency + document
> score for each value.
>
> Currently we are using stored fields and was wondering if this approach
> would be faster.
>
> Apologies if this is too much to ask for.
>
> Parvesh Garg,
>



-- 
Regards,
Shalin Shekhar Mangar.

Reply via email to