Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Solr function query that operates on count of multivalued field

Tags:

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?

like image 291
Dave Avatar asked Jun 04 '11 23:06

Dave


People also ask

What are multivalued fields?

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.

What is multivalued field in SOLR?

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.


1 Answers

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.

like image 186
Mauricio Scheffer Avatar answered Sep 17 '22 13:09

Mauricio Scheffer