【发布时间】:2016-06-20 15:55:49
【问题描述】:
我使用 PUT http://localhost:9200/test 创建这样的索引:
{
"settings": {
"number_of_shards": 1,
"analysis": {
"analyzer": {
"sortable": {
"type": "custom",
"tokenizer": "keyword",
"filter": [
"lowercase"
]
}
}
}
},
"mappings": {
}
}
返回:
{"acknowledged":true}
然后确保分析器在那里: http://localhost:9200/test/_analyze?_analyzer=sortable&text=HeLLo
{"tokens":[{"token":"hello","start_offset":0,"end_offset":5,"type":"<ALPHANUM>","position":0}]}
所以我为它创建了映射: 作者:PUT http://localhost:9200/test/_mapping/company
{
"properties": {
"name": {
"type": "string",
"analyzer": "standard",
"fields": {
"raw": {
"type": {
"analyzer": "sortable"
}
}
}
}
}
这会返回:
{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"no handler for type [{analyzer=sortable}] declared on field [raw]"}],"type":"mapper_parsing_exception","reason":"no handler for type [{analyzer=sortable}] declared on field [raw]"},"status":400}
怎么了?
【问题讨论】:
标签: elasticsearch