嗨,我正在尝试使用 .net sdk 在 azure 中执行搜索。我正在搜索的字段包含“/”字符。但是无论我做什么,搜索结果总是空的。我已经尝试过,HttpUtility.UrlEncode
但它仍然无法正常工作。下面是我尝试过的代码。有人可以帮忙吗,
using (var searchClient = _azureSearchConnector.GetSearchClient(_searchIndexName))
{
var searchParams = new SearchParameters
{
//example location = contact/DCA-000021978/AzureSearch/
Filter = $"fileLocation eq ' {location}'",
Select = new[] { "metadata_storage_name", "user", "metadata_storage_content_type",
"metadata_storage_size", "metadata_storage_last_modified",
"metadata_creation_date", "metadata_storage_path", "fileLocation"},
};
var result = searchClient.Documents.SearchWithHttpMessagesAsync("*", searchParams).Result;
return result.Body.Results.Select(t => (DocumentSearchModel)t.Document);
}