蔚蓝搜索;在特定字段内搜索
Azure Search; Search inside a specific field
在 Azure 搜索中,我可以在特定字段上进行搜索吗
示例:我有以下 "Research" 索引。
{
"Error": null,
"IsSuccess": true,
"StatusCode": 201,
"Body": {
"name": "Research",
"fields": [
{
"name": "Id",
"type": "Edm.String",
"searchable": false,
"filterable": false,
"sortable": false,
"facetable": false,
"suggestions": false,
"key": true,
"retrievable": true
},
{
"name": "Title",
"type": "Edm.String",
"searchable": true,
"filterable": false,
"sortable": false,
"facetable": false,
"suggestions": true,
"key": false,
"retrievable": true
},
{
"name": "Description",
"type": "Edm.String",
"searchable": true,
"filterable": false,
"sortable": false,
"facetable": false,
"suggestions": true,
"key": false,
"retrievable": true
},
{
"name": "Questions",
"type": "Collection(Edm.String)",
"searchable": true,
"filterable": false,
"sortable": false,
"facetable": false,
"suggestions": true,
"key": false,
"retrievable": true
},
],
"scoringProfiles": [],
"defaultScoringProfile": null,
"corsOptions": null
}
}
现在在搜索查询中,我可以要求 Azure 仅在 "Questions" 字段中搜索吗?
例如当用户搜索 "How Internet of things benefits automotive industry?" 并选择我只想在 "Questions" 中找到它时,我能做到吗?
是的,这可以使用 searchFields=[string]
参数。例如,在您的情况下,您可以将 &searchFields=Questions
添加到 URL 搜索请求中。您可以在此处了解更多相关信息:https://msdn.microsoft.com/en-us/library/azure/dn798927.aspx
在 Azure 搜索中,我可以在特定字段上进行搜索吗
示例:我有以下 "Research" 索引。
{
"Error": null,
"IsSuccess": true,
"StatusCode": 201,
"Body": {
"name": "Research",
"fields": [
{
"name": "Id",
"type": "Edm.String",
"searchable": false,
"filterable": false,
"sortable": false,
"facetable": false,
"suggestions": false,
"key": true,
"retrievable": true
},
{
"name": "Title",
"type": "Edm.String",
"searchable": true,
"filterable": false,
"sortable": false,
"facetable": false,
"suggestions": true,
"key": false,
"retrievable": true
},
{
"name": "Description",
"type": "Edm.String",
"searchable": true,
"filterable": false,
"sortable": false,
"facetable": false,
"suggestions": true,
"key": false,
"retrievable": true
},
{
"name": "Questions",
"type": "Collection(Edm.String)",
"searchable": true,
"filterable": false,
"sortable": false,
"facetable": false,
"suggestions": true,
"key": false,
"retrievable": true
},
],
"scoringProfiles": [],
"defaultScoringProfile": null,
"corsOptions": null
}
}
现在在搜索查询中,我可以要求 Azure 仅在 "Questions" 字段中搜索吗?
例如当用户搜索 "How Internet of things benefits automotive industry?" 并选择我只想在 "Questions" 中找到它时,我能做到吗?
是的,这可以使用 searchFields=[string]
参数。例如,在您的情况下,您可以将 &searchFields=Questions
添加到 URL 搜索请求中。您可以在此处了解更多相关信息:https://msdn.microsoft.com/en-us/library/azure/dn798927.aspx