# An error in calculating the scoring ball?

**URL:** <https://discuss.elastic.co/t/an-error-in-calculating-the-scoring-ball/230673>\
**Category:** Elasticsearch\
**Created:** [May 1, 2020, 7:37am UTC](https://discuss.elastic.co/t/an-error-in-calculating-the-scoring-ball/230673 "2020-05-01T07:37:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![iva3682](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/iva3682/32/67504_2.png) [@iva3682](https://discuss.elastic.co/u/iva3682)\
**Post date:** [May 1, 2020, 7:37am UTC](https://discuss.elastic.co/t/an-error-in-calculating-the-scoring-ball/230673/1 "2020-05-01T07:37:49Z")

</div>

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"`.

 ![Снимок](https://us1.discourse-cdn.com/elastic/original/3X/a/0/a09d4dce0d36e35c737ca28c1cde5467ddbd8591.png)

Index Settings:

```auto
[
	'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:

```auto
тв, телевизор
микроволновка, микроволновая печь, свч

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 29, 2020, 7:37am UTC](https://discuss.elastic.co/t/an-error-in-calculating-the-scoring-ball/230673/2 "2020-05-29T07:37:50Z")

</div>

Closed on May 29, 2020, 7:37am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
