1
Im使用天蓝色的搜索。我有我的id字段设置为可检索,但它没有得到我的搜索结果返回。你们知道为什么吗?我只在单个文档的搜索结果中看到:文档对象 - >键值。 (Im使用.net SDK)Azure搜索没有返回文档ID
我希望此ID能够执行文档查找并向消费者提供真实文档。
public static DocumentSearchResult GetSearchResult(ISearchIndexClient indexClient, string searchTerm)
{
SearchParameters parameters;
DocumentSearchResult results;
parameters =
new SearchParameters()
{
Select = new[] { "content" }
};
results = indexClient.Documents.Search(searchTerm, parameters);
return results;
}
我发现我可以把ID放在searchparameters中来检索它。这感觉不自然,但..
'这感觉不自然though' - >恭敬地我不同意。 'Select'是完全可选的,如果你省略这个,所有可检索的字段都会被返回。当您只需要一些可检索字段作为搜索结果的一部分返回时,可以使用“选择”。 –
在这种情况下,感觉很自然。 – Developerdeveloperdeveloper