Can I, within a Solr function query, count the number of values in a multivalued field? How would I write a function query that returns documents with, say, 3 or more values for a particular field?
A multivalued field (MVF) allows for the storage of more than one value in a database field. MVFs are somewhat controversial, with many arguing that they violate one of the very sacred tenets of database design as laid out by E.F.
A multivalued field is useful when there are more than one value present for the field. An easy example would be tags, there can be multiple tags that need to be indexed. so if we have tags field as multivalued then solr response will return a list instead of a string value.
Here's the function query reference, and it doesn't list anything like that, so I think it's safe to assume that there's no such thing.
If the value count is somehow relevant in your case, add it as a separate int field, then operate on that field.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With