尽管索引字段未找到建议字段

时间:2018-06-29 11:25:20

标签: elasticsearch nest

美好的一天:

我正在尝试对ElasticSearch进行自动完成。目前,我有一个映射为建议的字段。我有以下查询:

POST dev/facility/_search
{
  "suggest": {
        "song-suggest" : {
            "prefix" : "faci", 
            "completion" : { 
                "field" :"suggest" 
            }
        }
    }
}

但是,我收到此错误:no mapping found for field [suggest]。可以在此处看到我的映射:

{
  "dev": {
    "mappings": {
      "facility": {
        "properties": {
          "slug": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "state": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "suggest": {
            "properties": {
              "input": {
                "type": "text",
                "fields": {
                  "keyword": {
                    "type": "keyword",
                    "ignore_above": 256
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

我已使用NEST生成映射,这是我在字段上的注释:

    [Completion]
    public CompletionField Suggest { get; set; 

0 个答案:

没有答案
相关问题