Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: demonstrate opensearch-projectGH-128 is a feature, not a bug
Further investigation shows that a TermQuery with an empty string value is expected to be 'conditionless' in this codebase and the TermQuery implementation includes a .Verbatim() method to allow the client to serialize the query clause even though it evaluates to conditionless this allows me to create a query like this GET /index/_search { "query": { "bool": { "must": [ {"exists": { "field": "last_name"}} ], "must_not": [ {"term": {"last_name.keyword": {"value": ""}}} ] } } } using the following syntax client.Search<SampleDomainObject>(s => s .Query(q => q .Bool(b => b .Must(m => m.Exists(e => e.Field("last_name"))) .MustNot(m => m.Term(t => t.Verbatim().Field("last_name.keyword").Value(string.Empty))) ) ) .Index("index") .Source(sfd => null) ); thus resolving that opensearch-projectGH-281 is not a bug and is working as designed. Signed-off-by: David Alpert <[email protected]>
- Loading branch information