# About elastic full seach text score

**URL:** <https://discuss.elastic.co/t/about-elastic-full-seach-text-score/335598>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [June 9, 2023, 8:46am UTC](https://discuss.elastic.co/t/about-elastic-full-seach-text-score/335598 "2023-06-09T08:46:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![GithubRyze](https://avatars.discourse-cdn.com/v4/letter/g/c89c15/32.png) [@GithubRyze](https://discuss.elastic.co/u/GithubRyze)\
**Post date:** [June 9, 2023, 8:46am UTC](https://discuss.elastic.co/t/about-elastic-full-seach-text-score/335598/1 "2023-06-09T08:46:10Z")

</div>

We have 4 docs in Elastictsearch index. the docs content as below:

```auto
1. { “content”: "elastic a good engine"}
2. { “content”: "elastic a nice password"}
3. { “content”: "elastic password is 12344fe"}
4. { “content”: "password should be include #2jA"}

```

then we query by DSL:

```auto
{
    "query": {
        "simple_query_string": {
            "fuzzy_max_expansions": 50,
            "fuzzy_prefix_length": 0,
            "fuzzy_transpositions": true,
            "query": "elastic password"
        }
    }
}

```

Es query resutl:

```auto
{
    "took": 1,
    "timed_out": false,
    "_shards": {
        "total": 1,
        "successful": 1,
        "skipped": 0,
        "failed": 0
    },
    "hits": {
        "total": {
            "value": 4,
            "relation": "eq"
        },
        "max_score": 0.7309394,
        "hits": [
            {
                "_index": "gatewaylog-test",
                "_id": "7wTrnogBCK1n0bp4ZOiJ",
                "_score": 0.7309394,
                "_source": {
                    "content": "elastic a nice password"
                }
            },
            {
                "_index": "gatewaylog-test",
                "_id": "8ATrnogBCK1n0bp4h-g2",
                "_score": 0.7309394,
                "_source": {
                    "content": "elastic password is 12344fe"
                }
            },
            {
                "_index": "gatewaylog-test",
                "_id": "7gTrnogBCK1n0bp4POhE",
                "_score": 0.3654697,
                "_source": {
                    "content": "elastic a good engine"
                }
            },
            {
                "_index": "gatewaylog-test",
                "_id": "8QTrnogBCK1n0bp4q-iG",
                "_score": 0.33265942,
                "_source": {
                    "content": "password should be include #2jA"
                }
            }
        ]
    }
}

```

We expected doc `{ "content": "elastic password is 12344fe"} ` is the highest score. but ES tell us`{ "content": "elastic password is 12344fe"} ` as same as ` { “content”: "elastic a nice password"}`。

So any friend can help us. how do we can get the expected result by query??? thanks .

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 9, 2023, 10:39am UTC](https://discuss.elastic.co/t/about-elastic-full-seach-text-score/335598/2 "2023-06-09T10:39:03Z")

</div>

If you want to make relevant the position of the terms, you can use a [Shingle Tokenizer](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-shingle-tokenfilter.html) in your analyzer.

---

<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:** [July 7, 2023, 10:39am UTC](https://discuss.elastic.co/t/about-elastic-full-seach-text-score/335598/3 "2023-07-07T10:39:26Z")

</div>

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