ca40c6191c
a `TermQuery` with an empty string `Value` is considered by the .NET client to be "conditionless" and is removed from the search request body by default. for those times that you want to use a `TermQuery` with an empty string `Value` (e.g. show me all documents with a non-empty last_name property) you need to use the `.Verbatim()` method to tell the client library to include the `TermQuery` as written even though it is considered to be "conditionless". in other words, while a "conditionless" query may not make sense in the positive it can make sense in the negative ``` GET /my-index/_search { "query": { "bool": { "must": [{ "exists": { "field": "last_name"} }], "must_not": [{ "term": {"last_name.keyword": { "value": "" }} }] } }, } ``` Signed-off-by: David Alpert (Next League) <112503249+david-alpert-nl@users.noreply.github.com> |
||
---|---|---|
.. | ||
javascript | ||
OSC-dot-net.md | ||
OSC-example.md | ||
OpenSearch-dot-net.md | ||
dot-net-conventions.md | ||
dot-net.md | ||
go.md | ||
index.md | ||
java-rest-high-level.md | ||
java.md | ||
opensearch-py-ml.md | ||
php.md | ||
python-high-level.md | ||
python-low-level.md | ||
ruby.md | ||
rust.md |