I have an array field in Solr. example: "variant_qty": [ 1, 0, 7, 9 ]
I want to do that : get records if one value > 0 others must be zero.
how i can do that with solr query ?
I have an array field in Solr. example: "variant_qty": [ 1, 0, 7, 9 ]
I want to do that : get records if one value > 0 others must be zero.
how i can do that with solr query ?
I'm not sure if you can. The straight forward solution would be to index a boolean field that determines whether the condition is true, i.e. only_one_variant_qty:1
.
You might be able to hack something together using the Streaming Expressions API or a mishmash of function queries, but I weren't able to see a possible solution.