我正在尝试将我的一个字段配置为使用edge ngram标记器。我正在尝试翻译我找到的以下要点(https://gist.github.com/1037563):
{
"mappings": {
"contact": {
"properties": {
"twitter": {
"type": "object",
"properties": {
"profile": {
"fields": {
"profile": {
"type": "string",
"analyzer": "left"
},
"reverse_profile": {
"type": "string",
"analyzer": "right"
}
},
"type": "multi_field"
}
}
}
}
}
},
"settings": {
"analysis": {
"analyzer": {
"left": {
"filter": [
"standard",
"lowercase",
"stop"
],
"type": "custom",
"tokenizer": "left_tokenizer"
},
"right": {
"filter": [
"standard",
"lowercase",
"stop"
],
"type": "custom",
"tokenizer": "right_tokenizer"
}
},
"tokenizer": {
"left_tokenizer": {
"side": "front",
"max_gram": 20,
"type": "edgeNGram"
},
"right_tokenizer": {
"side": "back",
"max_gram": 20,
"type": "edgeNGram"
}
}
}
}
}我可以看到pyes支持'put_mapping‘API,但这似乎将所有东西都包装在了'mappings’中。我需要能够在“设置”键下通过分析器,但不知道如何操作。
有人能帮上忙吗?
发布于 2012-05-02 07:56:42
您应该能够将此结构作为create_index的第二个参数进行传递。
https://stackoverflow.com/questions/10394380
复制相似问题