Get document's fields has more than N elements


Get document's fields has more than N elements



In SOLR I have documents has fields like below;


"geolocation": [
"40.154400,-75.279900",
"40.117416,-75.119203",
"40.23931,-75.23126",
"40.18417,-75.07946"
]



I would like to get documents have geolocation field has more than 3 items, such as above.


geolocation



How can I write this filter in solr?



I am looking something like;



len(geolocation) >= 3




1 Answer
1



upon indexing, just add the length of that field to another, custom field, then query the later one. There are several ways you can do this:






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

JMeter fails on beanshell imports

Why in node-red my HTTP POST no receive payload from inject?

PHP contact form sending but not receiving emails