Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

to get the count of multi valued field in solr

Tags:

solr

solrj

In solr i have a multiValued field called animal and it has the values {cat,dog} is it possible to get the number of values inside the multiValued field in solr(in my example 2)?

like image 349
ak87 Avatar asked Dec 12 '12 10:12

ak87


2 Answers

If you want to count the items in a multivalued field use CountFieldValuesUpdateProcessorFactory

like image 102
Okke Klein Avatar answered Oct 07 '22 13:10

Okke Klein


There is no direct way to get the count of items in a multivalued field.
You can always maintain the field count during indexing and use it.

If not using during query time, you can always count the list size.

like image 27
Jayendra Avatar answered Oct 07 '22 12:10

Jayendra