# Take (length of the aliases field) out of score calculation

**URL:** <https://discuss.elastic.co/t/take-length-of-the-aliases-field-out-of-score-calculation/233250>\
**Category:** Elasticsearch\
**Created:** [May 19, 2020, 6:12am UTC](https://discuss.elastic.co/t/take-length-of-the-aliases-field-out-of-score-calculation/233250 "2020-05-19T06:12:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Muhammad\_Vakili](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/muhammad_vakili/32/48133_2.png) [@Muhammad\_Vakili](https://discuss.elastic.co/u/Muhammad_Vakili)\
**Post date:** [May 19, 2020, 6:12am UTC](https://discuss.elastic.co/t/take-length-of-the-aliases-field-out-of-score-calculation/233250/1 "2020-05-19T06:12:04Z")

</div>

Suppose we have a documents of people with their name and array of aliases like this:

```auto
{
   name: "Christian",
   aliases: ["נוצרי", "کریستیان"]
}

```

Suppose I have a document with 10 aliases and another one with 2 aliases  
but both of them contains alias with value `کریستیان`.

The `length of field (dl)` for the first document is bigger than the second document  
so the `term frequency (tf)` of the first document gets lower than the second one  
and the score of the document with less aliases is bigger than another.

Sometimes I want to add more aliases for person in different languages and different forms because he/she is more famous but it causes to get lower score in results. I want to somehow take `length of the aliases field` out of my query's calculation.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [May 23, 2020, 9:46pm UTC](https://discuss.elastic.co/t/take-length-of-the-aliases-field-out-of-score-calculation/233250/2 "2020-05-23T21:46:29Z")

</div>

Can you perhaps add the alias match as a [filter clause](https://www.elastic.co/guide/en/elasticsearch/reference/7.7/query-dsl-bool-query.html) to avoid it affecting scoring at all?

---

<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:** [June 20, 2020, 9:46pm UTC](https://discuss.elastic.co/t/take-length-of-the-aliases-field-out-of-score-calculation/233250/3 "2020-06-20T21:46:34Z")

</div>

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