0
我有elasticsearchElasticsearch方面當屬空白標記化
{
"mappings": {
"hotel": {
'properties': {"name": {
"type": "string",
"search_analyzer": "str_search_analyzer",
"index_analyzer": "str_index_analyzer"},
"destination": {'properties': {'en': {
"type": "string",
"search_analyzer": "str_search_analyzer",
"index_analyzer": "str_index_analyzer"}}},
"country": {"properties": {"en": {
"type": "string",
"search_analyzer": "str_search_analyzer",
"index_analyzer": "str_index_analyzer"}}},
"destination_facets": {"properties": {"en": {
"type": "string",
"search_analyzer": "facet_analyzer"
}}}
}
}
},
"settings": {
"analysis": {
"analyzer": {
"str_search_analyzer": {
"tokenizer": "keyword",
"filter": ["lowercase"]
},
"str_index_analyzer": {
"tokenizer": "keyword",
"filter": ["lowercase", "substring"]
},
"facet_analyzer": {
"type": "keyword",
"tokenizer": "keyword"
},
},
"filter": {
"substring": {
"type": "edgeNGram",
"min_gram": 1,
"max_gram": 20,
}
}
}
}
}
,我想我的destination_facets將不記號化下面的映射。但它是以白色空間標記的。有沒有辦法忽略所有的令牌活動?
如果我可以添加一些細節。搜索分析器在執行支持文本分析的查詢時使用,而不僅僅是query_string。在這種情況下,您必須更改index_analyzer,因爲您在分面時顯示的內容是您編制索引的內容,並且爲了索引它,您可以對其應用文本分析。在索引時間使用的分析器是index_analyzer。 – javanna