We encounter a query case that to filter doc if a specified multivalued filed contains only one value.
For instance:
We have an index of suit, including clothes ,trousers or other things. If there is only one product within a suit due to out of stock, we can’t show the suit to user, because it’s not ‘suit’.
Here is our data:
<doc>
<int name="suitId">001</int>
<arr name="productName">
<str>T-shirt</str>
<str>jeans</str>
</arr>
</doc>
<doc>
<int name="suitId">002</int>
<arr name="productName">
<str>T-shirt</str>
</arr>
</doc>
We wanna except the suit of suitId=002.
It would be better to have a separate field maintaining the count of the products for a suit and use it to filter the suits.
I don’t think you can use the range queries for the text multivalued fields.
you can probably use
productName:[* TO *]to select suit having atleast one product, but not the count.