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)?
Asked
Active
Viewed 5,549 times
7
-
directly, you can't. you could still facet over that field and sum up the facet counts, somehow. – Samuele Mattiuzzo Dec 12 '12 at 11:21
-
yup. For that you have to query that individual document, so that it will provide you the exact facet count for that document only. – Jayendra Dec 12 '12 at 11:26
-
is there any way to do this via apache luke? – ak87 Dec 12 '12 at 11:56
-
luke just gives you the inside of the index. You can look and still have to count it. – Jayendra Dec 12 '12 at 12:00
2 Answers
4
If you want to count the items in a multivalued field use CountFieldValuesUpdateProcessorFactory

Okke Klein
- 2,549
- 17
- 9
1
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.

Jayendra
- 52,349
- 4
- 80
- 90