I can't quite get my head around a specific search requirement I have, so I
hope someone can help.
My documents have a field "published" with a string value "yes" or "no"
(not boolean true/false, indexed data out of my control at present!). This
defines whether the document has been published or not, obviously. I have a
fairly large boolean query of a series of "must" sub-queries, of which one
is on this published field, ensuring that only those "yes" are returned.
However I've just realised that this field is optional in the document.
If it doesn't have a yes/no value, then the assumption is that the document
is published ("yes") and should be returned. So in essence I want to add a
must clause for this field only when it exists and has a value. Is this
even possible? Should I perhaps use a filter here?
Any ideas gratefully received.
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firstname.lastname@example.org.
For more options, visit https://groups.google.com/groups/opt_out.