【发布时间】:2017-05-24 16:04:54
【问题描述】:
是否可以在 Wagtail elasticsearch 2.4 搜索后端设置 ascii 折叠,例如搜索“Nimes”会返回带有“Nîmes”索引的对象?
我尝试添加以下设置:
WAGTAILSEARCH_BACKENDS = {
'default': {
'BACKEND': 'app.search.backend',
'URLS': ['http://search:9200'],
'INDEX': 'wagtail',
'TIMEOUT': 5,
'INDEX_SETTINGS': {
'settings': {
'analysis': {
'analyzer': {
'ngram_analyzer': {
'type': 'custom',
'tokenizer': 'lowercase',
'filter': ['asciifolding', 'ngram']
},
'edgengram_analyzer': {
'type': 'custom',
'tokenizer': 'lowercase',
'filter': ['asciifolding', 'edgengram']
},
"folding": {
"tokenizer": "standard",
"filter": ["lowercase", "asciifolding"]
}
}
}
}
}
}
}
但它不起作用。 我在 Django 1.10.7 和 Python 3.5.2 上使用 Wagtail 1.9。
【问题讨论】:
标签: django python-3.x elasticsearch wagtail