I am not aware of any function query to get the value count for a multivalued field.

You could write a custom update processor which counted the values and then stored the count in another field. Then you could do a numeric range query on that other field. Or maybe even store a boolean in another field to indicate whether the field had a single value or more than a threshold count of values, or whatever custom calculation you wanted.

Of course, you could also count the values yourself and setting a separate count field before submitting the document to Solr.

See SOLR-2802 - "Toolkit of UpdateProcessors for modifying document values" for some possible base classes for such an update processor. This is for 4.x, not 3.6. For older releases, you will have to do it all yourself.
https://issues.apache.org/jira/browse/SOLR-2802

-- Jack Krupansky

-----Original Message----- From: preetesh dubey
Sent: Friday, June 08, 2012 12:22 PM
To: solr-user@lucene.apache.org
Subject: terms count in multivalues field

Is it possible to get number of entries present in a multivalued field by
solr query. Lets say I want to query to solr to get all documents having *
count* of some multivalued field >1. Is it possible in solr ?

--
Thanks & Regards
Preetesh Dubey

Reply via email to