A nested query has to be marked Verbatim, even when its query is marked Verbatim, because the conditionless check on the nested query does not take into account the query being marked Verbatim.
Consider
var searchResponse = client.Search<Question>(s => s
.Query(q => q
.Bool(b1 => b1
.Must(q1 => q1
.Nested(n => n
.Path("Applicants")
.Query(q3 => q3
.Term(t => t
.Field("Applicants.Surname")
.Value("")
.Verbatim())
)
), q1 => q1
.Term(t => t
.Field("Application_Type")
.Value("")
.Verbatim()
)
)
)
)
);
A
nested
query has to be markedVerbatim
, even when itsquery
is markedVerbatim
, because the conditionless check on thenested
query does not take into account thequery
being markedVerbatim
.Consider
The
nested
query is omitted from the requestbecause the conditionless check on
nested
query does not take into account thequery
being markedVerbatim
(orStrict
)https://github.com/elastic/elasticsearch-net/blob/c3301149632df4611bb09da7eb0526db6f3d8ae0/src/Nest/QueryDsl/Joining/Nested/NestedQuery.cs#L39
With the
nested
query marked asVerbatim()
, the query serializesyields
Propose that
nested
query conditionless check should check thatquery
is conditionless only if it is not verbatim or strict.