Elasticsearch & NEST with .NET - 未返回任何数据
本文关键字:返回 任何 数据 NET with amp NEST Elasticsearch | 更新日期: 2023-09-27 18:34:10
NEST中是否有任何调试?我浪费了很多时间,没有任何错误代码。我没有返回任何数据,但数据存在。代码如下 -
Uri node;
ConnectionSettings settings;
//ElasticClient client;
node = new Uri("https://.......qb0x.com:30950");
settings = new ConnectionSettings(node, defaultIndex: "soogrindex");
var client = new ElasticClient(settings);
SearchResults sr = new SearchResults();
var searchDataResults = client.Search<SearchRow>(s=>s.AllIndices().AllTypes().Query(q=>q.Term(p=>p.partnumber, "*")));
任何想法如何调试?它只是什么也不返回。ubuntu 中的卷曲显示那里的数据。.net 位于窗口下。
解决方案是关于大小写的,数据有"Test2",但搜索在"Test2"上不匹配,但"test2"有效。我不知道为什么,但必须在 ES 中设置默认值。
这是更正后的表格 -
var searchDataResults = client.Search<SearchRow>(s=>s.AllIndices().AllTypes().Query(q=>q.Term(p=>p.partnumber, "test2")));