NEST中是否有任何调试?我浪费了很多时间,没有任何错误代码。我没有返回数据,但数据存在。代码如下 -Elasticsearch&NEST with .NET - 无数据返回
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中的curl显示那里的数据。 .net在windows下。
你能提供数据的例子吗?只是你的文档的示例json。看来这个查询是错误的。 –
curl -XGET'https://23ebed6f82b55e4b7cf1:[email protected]:30950/soogrindex/_search?q = partnumber:Test *' {“took”:5,“timed_out”:false,“_ shards”: { “总”:4, “成功”:4, “失败”:0}, “命中”:{ “总”:390, “MAX_SCORE”:1.0, “命中”:[{ “_索引”: “soogrindex” ,“_ type”:“searchrow”,“_ id”:“AVLFwBYtaAnYOoMODY4R”,“_ score”:1.0,“_ source”:{ “partid”:2, “partnumber”:“Test2” –
你可以试试这个: var searchDataResults = client.Search(s => s.AllIndices()。AllTypes()); –