使用空字段查找文档/附件。使用Nest + C#进行弹性搜索时的内容

问题描述 投票:0回答:1

我正在尝试搜索具有空白字段的文档。这些尝试不起作用:

var searchResult1 = client.Search<Doc>(s => s
    .From(0)
    .Size(10)
    .Query(q => q
        .Match(m => m
        .Field(f => f.Attachment.Content)
        .Query("")
        )
    )
);

var searchResult2 = client.Search<Doc>(x => x
    .Query(query => query
        .Term(term => term
        .Field(new Field("Attachment.Content"))
        .Value("")
        )
    )
);

请注意,附件的类型为Nest.Attachment。

c# elasticsearch nest
1个回答
1
投票

您是否已经尝试过Verbatim()

© www.soinside.com 2019 - 2024. All rights reserved.