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()); –