하이픈을 포함하는 필드에서 와일드 카드를 사용하여 쿼리 문자열을 검색 할 수 있도록 elasticsearch를 구성하는 방법을 알아 냈습니다. 나는 word_delimiter 필터와 공백 토크 나이를 사용하는 것을 시도했다Elasticsearch에 하이픈이있는 인덱스 필드
{
"tags":[
"deck-clothing-blue",
"crew-clothing",
"medium"
],
"name":"Crew t-shirt navy large",
"description":"This is a t-shirt",
"images":[
{
"id":"ba4a024c96aa6846f289486dfd0223b1",
"type":"Image"
},
{
"id":"ba4a024c96aa6846f289486dfd022503",
"type":"Image"
}
],
"type":"InventoryType",
"header":{
}
}
:
나는 다음과 같이 문서가
{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 1
},
"analysis" : {
"filter" : {
"tags_filter" : {
"type" : "word_delimiter",
"type_table": ["- => ALPHA"]
}
},
"analyzer" : {
"tags_analyzer" : {
"type" : "custom",
"tokenizer" : "whitespace",
"filter" : ["tags_filter"]
}
}
}
},
"mappings" : {
"yacht1" : {
"properties" : {
"tags" : {
"type" : "string",
"analyzer" : "tags_analyzer"
}
}
}
}
}
을하지만 이것들은 (태그)을 검색하고 자신을 검색 결과 :
deck* -> match
deck-* -> no match
deck-clo* -> no match
어디서 잘못 볼 수 있습니까?
감사합니다 :)
필터를 제거하면 어떻게됩니까? – concept47
필터를 제거해도 검색 결과에 영향을 미치지 않습니다. 이것이 내가 함께 종료 된 설정입니다 :) –