Good afternoon! I can’t understand why this is happening? The example in the attachment. Expect item with
["CategoryName": "Бытовая техника / Встраиваемая техника / Микроволновые печи", "FullCategoryName": ""]
will be higher than the element with
["CategoryName": "Аксессуары для микроволновых печей", "FullCategoryName": "Встраиваемая техника"]
, as in the first element there are two matches for the field "CategoryName.Synonym^5", and in the second only one for the field "CategoryName.Synonym^5"
, and one for "FullCategoryName.Synonym"
.
Index Settings:
[
'index_patterns' => 'category-*',
'settings' => [
'number_of_shards' => 1,
'number_of_replicas' => 0,
'analysis' => [
'analyzer' => [
'CategoryNameAnalyzerNgram' => [
'tokenizer' => 'category_ngram_analyzer',
'filter' => [
'lowercase'
]
],
'category_name_russian' => [
'tokenizer' => 'standard',
'filter' => [
'lowercase',
'russian_stop',
'russian_keywords',
'russian_stemmer',
'categoryname_synonym',
'unique'
]
]
],
'filter' => [
'russian_stop' => [
'type' => 'stop',
'stopwords' => '_russian_'
],
'russian_keywords' => [
'type' => 'keyword_marker',
'keywords' => [
'пример'
]
],
'russian_stemmer' => [
'type' => 'stemmer',
'language' => 'russian'
],
'categoryname_synonym' => [
'type' => 'synonym',
'synonyms_path' => 'synonym/pricehub/CategoryName.txt'
]
],
'tokenizer' => [
'category_ngram_analyzer' => [
'type' => 'ngram',
'min_gram' => 3,
'max_gram' => 3,
'token_chars' => [
'letter',
'digit'
]
]
]
]
],
'mappings' => [
'properties' => [
'suggest' => [
'type' => 'completion'
],
'FullCategoryName' => [
'type' => 'text',
'fields' => [
'Ngram' => [
'type' => 'text',
'analyzer' => 'CategoryNameAnalyzerNgram'
],
'Synonym' => [
'type' => 'text',
'analyzer' => 'category_name_russian'
]
]
],
'CategoryName' => [
'type' => 'text',
'fields' => [
'Ngram' => [
'type' => 'text',
'analyzer' => 'CategoryNameAnalyzerNgram'
],
'Synonym' => [
'type' => 'text',
'analyzer' => 'category_name_russian'
]
]
],
'Link' => [
'type' => 'keyword',
'index' => false
],
'DomenID' => [
'type' => 'long'
],
'CategoryID' => [
'type' => 'long'
],
'ContainerID' => [
'type' => 'long',
'index' => false
],
'CityID' => [
'type' => 'long'
],
'StatusID' => [
'type' => 'long'
]
]
]
]
Synonyms File:
тв, телевизор
микроволновка, микроволновая печь, свч