0

鉴于我的索引配置如下:

{
  "Error": null,
  "IsSuccess": true,
  "StatusCode": 201,
  "Body": {
    "name": "test-want-index",
    "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
      },
    ],
    "scoringProfiles": [],
    "defaultScoringProfile": null,
    "corsOptions": null
  }
}

填充了以下数据:

Id:123, Title:starbucks, Description:coffee that is good
Id:456, Title:big b, Description:coffee that is bad
Id:789, Title:elk brand, Description:we have elk stars

当用户输入以下查询时starbucs coffee

是否可以配置索引字段以便我可以:

  1. 匹配 id 为 123 和 id 为 456 的项目
  2. 模糊搜索(或建议?)标题和描述

笔记:

  1. 输入stabuck作为建议的搜索词返回 id 123
  2. 输入coffee作为建议的搜索词返回 id 456
  3. 输入starbucs coffee不会返回任何内容。<-我的问题
4

2 回答 2

6

We don't currently handle spelling corrections/fuzzy queries on search. We're working on making linguistics better in general this a number of these things will improve over time.

In this particular case, search and suggestions don't return anything for different reasons:

Search comes back empty because it doesn't do fuzzy matching, thus starbucs doesn't match. Note that if searchMode is set to "any" (default), the document should still come back because "coffee" is a match.

Suggestions come back empty because it does a full match only, and there's no single field that contains the whole string "starbucks coffee" (with or without misspellings). We've gotten a ton of "passionate feedback" about the fact that suggestions is prefix-only, and we're looking at how to make this more flexible.

Sorry I don't have a very actionable answer, other than making sure you have &searchMode=any so search will match other words. The rest will get better but we need a bit of time. We push new bits with new functionality every week, so things are progressing quickly.

于 2014-10-09T01:35:01.947 回答
0

它现在作为建议器中的一项功能提供,请参阅https://msdn.microsoft.com/en-us/library/azure/dn798936.aspx

于 2016-05-03T07:32:01.260 回答