Azure搜索;在特定字段内搜索 [英] Azure Search; Search inside a specific field

查看:89
本文介绍了Azure搜索;在特定字段内搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在Azure搜索中进行特定字段的搜索

In Azure Search can i do searching on specific field(s)

示例:我具有以下研究"索引.

Example: I have the below "Research" Index.

{
  "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仅在问题"字段中进行搜索吗?

Now in the search query can I ask Azure to search only in the "Questions" field?

例如当用户搜索物联网如何使汽车行业受益?"时并选择我只想在问题"中找到它即可.

E.g. When user search for "How Internet of things benefits automotive industry?" and selects i want to find this in only "Questions" would i able to do that.

推荐答案

是的,可以使用searchFields=[string]参数来实现.例如,在您的情况下,您可以将&searchFields=Questions添加到URL搜索请求中.您可以在此处了解更多信息: https://msdn.microsoft.com/en-us/library/azure/dn798927.aspx

Yes, this is possible using the searchFields=[string] parameter. For example, in your case you would add &searchFields=Questions to your URL search request. You can learn more about this here: https://msdn.microsoft.com/en-us/library/azure/dn798927.aspx

这篇关于Azure搜索;在特定字段内搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆