나는 탄성 검색에 이상한 행동을하고 있습니다. 공백, +, -의 경우 단어를 스펠링하는 맞춤형 토크 나이저와 함께 맞춤 분석기를 사용하고 있습니다.elasticsearch phrase_prefix 예상 결과
내가
{
"query": {
"match_phrase_prefix": {
"name.default": {
"query": "paris oly"
}
}
}
}
을 찾고 있어요 내가 같은 결과를 얻을 수 나는 전혀 결과를 얻을 올림피아 등 ... 하지만
{
"query": {
"match_phrase_prefix": {
"name.default": {
"query": "paris ol"
}
}
}
}
을 찾고 있어요 예상 파리.
설정 :
"analysis": {
"analyzer": {
"customAnalyzer": {
"type": "custom",
"filter": "lowercase",
"tokenizer": "customTokenizer"
},
"tokenizer": {
"customTokenizer": {
"pattern": "[\\+\\s-]",
"type": "pattern"
}
}
}
필드 매핑 다음 문서의 일부
{
"name": {
"properties": {
"default": {
"type": "string",
"analyzer": "customAnalyzer"
}
}
}
}
샘플 (요청 필드) :
{
"name": {
"jp": "パリ オリンピア (劇場)",
"default": "Paris Olympia",
}
}
{
"TYPE_NAME": {
"dynamic_templates": [
{
"name": {
"path_match": "*name.*",
"match_mapping_type": "string",
"mapping": {
"type": "string",
"analyzer": "customAnalyzer"
}
}
}
],
"properties": {
"point": {
"type": "geo_point"
}
}
}
}
분석기 및 몇 가지 샘플 문서를 포함하여 매핑을 게시 할 수 있습니까? –
감사합니다. 게시물을 편집했습니다. – Ofab