ak87
ak87

Reputation: 161

to get the count of multi valued field in solr

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)?

Upvotes: 7

Views: 5824

Answers (2)

Okke Klein
Okke Klein

Reputation: 2549

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

Upvotes: 4

Jayendra
Jayendra

Reputation: 52809

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.

Upvotes: 1

Related Questions