为percolate查询创建索引

时间:2017-08-30 06:39:00

标签: c# elasticsearch nest

我尝试在弹性搜索中进行percolate查询,但创建了一个索引,如docs中所述,我遇到了错误。我运行了以下内容:

PUT /my_percolate_index
{
  "mappings": {
    "doctype": {
        "properties": {
            "message": {
                "type": "text"
            }
        }
    },
    "queries": {
        "properties": {
            "query": {
                "type": "percolator"
            }
        }
    }
  }
}

我发出以下错误:

{
  "error": {
    "root_cause": [
     {
       "type": "illegal_argument_exception",
       "reason": "Rejecting mapping update to [my_percolate_index] as the final mapping would have more than 1 type: [doctype, queries]"
     }
   ],
   "type": "illegal_argument_exception",
   "reason": "Rejecting mapping update to [my_percolate_index] as the final mapping would have more than 1 type: [doctype, queries]"
  },
  "status": 400
}

我在这里错过了什么吗?

1 个答案:

答案 0 :(得分:0)

Since you're using ES 6,您只需移动映射类型中的ValueError: No variables to save字段

即可
query

请注意,从ES 6开始,任何索引中只允许使用一种映射类型。