【发布时间】:2021-05-16 00:40:50
【问题描述】:
我使用 ES v7。我想用 ElasticSearch 索引电子邮件地址,但使用 uax_url_email 标记器。 我想用完整的电子邮件地址搜索 Elastic。
我尝试使用此映射:
PUT /test
{
"settings": {
"analysis": {
"filter": {
"email": {
"type": "pattern_capture",
"preserve_original": 1,
"patterns": [
"([^@]+)",
"(\\p{L}+)",
"(\\d+)",
"@(.+)",
"([^-@]+)"
]
}
},
"analyzer": {
"email": {
"tokenizer": "uax_url_email",
"filter": [
"email",
"lowercase",
"unique"
]
}
}
}
},
"mappings": {
"emails": {
"properties": {
"email": {
"type": "string",
"analyzer": "email"
}
}
}
}
}
但出现错误
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "Failed to parse value [1] as only [true] or [false] are allowed."
}
],
"type": "illegal_argument_exception",
"reason": "Failed to parse value [1] as only [true] or [false] are allowed."
},
"status": 400
}
它有什么问题?这个映射应该是什么样子?
【问题讨论】:
标签: elasticsearch elasticsearch-mapping