# Ngram score and length

**URL:** <https://discuss.elastic.co/t/ngram-score-and-length/163697>\
**Category:** Elasticsearch\
**Created:** [January 10, 2019, 9:51am UTC](https://discuss.elastic.co/t/ngram-score-and-length/163697 "2019-01-10T09:51:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Destroy666](https://avatars.discourse-cdn.com/v4/letter/d/e9a140/32.png) [@Destroy666](https://discuss.elastic.co/u/Destroy666)\
**Post date:** [January 10, 2019, 9:51am UTC](https://discuss.elastic.co/t/ngram-score-and-length/163697/1 "2019-01-10T09:51:31Z")

</div>

Hi,

I noticed that when using the following:

```
analysis:
                filter:
                    ngram:
                        type: nGram
                        min_gram: 2
                        max_gram: 32
                    arabic_stop:
                        type: stop
                        stopwords: _arabic_
                    arabic_stemmer:
                        type: stemmer
                        language: arabic

analyzer:
                    search_arabic:
                        tokenizer: keyword
                        filter:
                            - lowercase
                            - arabic_normalization
                    index_arabic_ngram:
                        tokenizer: standard
                        filter:
                            - lowercase
                            - arabic_normalization
                            - ngram
                    search_arabic_ngram:
                        tokenizer: standard
                        filter:
                            - lowercase
                            - arabic_normalization

nameAr:
                        type: text
                        analyzer: search_arabic
                        fields:
                            ngram:
                                type: text
                                analyzer: index_arabic_ngram
                                search_analyzer: search_arabic_ngram
                            raw:
                                type: keyword
                                index: false

```

And I'm querying nameAr.ngram with a Match query. I noticed that some phrases have bigger score even though they are longer. Example: you search "word" and "some word here" has lower score than "word in another phrase", What would be the easieast way to boost the criteria of length in ES 6.3?

---

<div class="post-metadata">

**Author:** ![Destroy666](https://avatars.discourse-cdn.com/v4/letter/d/e9a140/32.png) [@Destroy666](https://discuss.elastic.co/u/Destroy666)\
**Post date:** [January 14, 2019, 1:54pm UTC](https://discuss.elastic.co/t/ngram-score-and-length/163697/2 "2019-01-14T13:54:58Z")

</div>

Anyone, please?

---

<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:** [February 11, 2019, 1:55pm UTC](https://discuss.elastic.co/t/ngram-score-and-length/163697/3 "2019-02-11T13:55:40Z")

</div>

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