15 pound chocolate cake
과 같은 문구에 적절한 토큰을 생성하도록 Elasticsearch를 가져 오는 데 문제가 있습니다.탄성 검색에서 숫자 토큰을 생성하지 않습니다.
pou poun pound cho choc choco chocol chocola chocolat chocolate cak cake
는 내가 거기에 모두 번호가 표시되지 않습니다 수행하고 해당 필드에 fielddata_field
쿼리 할 때 그것은 결과 따라 뭔가를 생성합니다. 나는 분석기 옵션의 몇 가지 조합을 시도해 보았다. 내가 같은 nGram
필터를 시도
{ "settings" : { "index" : { "analysis": { "filter": { "nGram_filter": { "type": "edge_ngram", "min_gram": 3, "max_gram": 20 }, "my_word": { "type":"word_delimiter", "preserve_original": "true" } }, "analyzer": { "nGram_analyzer": { "type": "custom", "tokenizer": "standard", "filter": [ "standard", "lowercase", "asciifolding", "my_word", "nGram_filter" ] }, "whitespace_analyzer": { "type": "custom", "tokenizer": "whitespace", "filter": [ "lowercase", "asciifolding" ] } } }} }, "mappings": { "categories": { "properties": { "id": {"type": "text"}, "sort": {"type": "long"}, "search_term":{"type":"text","analyzer": "nGram_analyzer","search_analyzer": "whitespace_analyzer", "fielddata":true} } } } }
:
"nGram_filter": { "type": "edge_ngram", "min_gram": 3, "max_gram": 20, "token_chars": [ "letter", "digit", "punctuation", "symbol" ] }
word_delimiter
에
"generate_number_parts": "true"
"generate_word_parts": true
설정 아래 내 매핑입니다.
편집 나는 그것이 2로 min_gram
크기를 변경하여 작업있어하지만 난 3의 그램 크기를 유지뿐만 아니라 같은 번호를 유지하는 방법이 있는지 궁금 오전 3시를 유지하기 위해 기대했다 뭐야?
알고 싶은 것을 성취하기위한 대안이 있습니까? – Yamaha32088
min_gram 크기를 2로 변경하지 않은 구체적인 이유는 무엇입니까? – Rahul