title: elasticsearch results have wrong scoring
body: <p>I have problem with elasticsearch scoring in my index. First I show the codes then I explain my problem.</p>
  <p>my index setting:</p>
  <pre><code>{
    &quot;crucial&quot;: {
      &quot;aliases&quot;: {},
      &quot;mappings&quot;: {
        &quot;properties&quot;: {
          &quot;brand_id&quot;: {
            &quot;type&quot;: &quot;long&quot;
          },
          &quot;brand_name&quot;: {
            &quot;type&quot;: &quot;text&quot;,
            &quot;analyzer&quot;: &quot;autocomplete&quot;,
            &quot;search_analyzer&quot;: &quot;autocomplete_search&quot;
          },
          &quot;category_name&quot;: {
            &quot;type&quot;: &quot;text&quot;,
            &quot;fields&quot;: {
              &quot;keyword&quot;: {
                &quot;type&quot;: &quot;keyword&quot;,
                &quot;ignore_above&quot;: 256
              }
            }
          },
          &quot;id&quot;: {
            &quot;type&quot;: &quot;long&quot;
          },
          &quot;name&quot;: {
            &quot;type&quot;: &quot;text&quot;,
            &quot;analyzer&quot;: &quot;autocomplete&quot;,
            &quot;search_analyzer&quot;: &quot;autocomplete_search&quot;
          }
        }
      },
      &quot;settings&quot;: {
        &quot;index&quot;: {
          &quot;max_ngram_diff&quot;: &quot;10&quot;,
          &quot;routing&quot;: {
            &quot;allocation&quot;: {
              &quot;include&quot;: {
                &quot;_tier_preference&quot;: &quot;data_content&quot;
              }
            }
          },
          &quot;number_of_shards&quot;: &quot;1&quot;,
          &quot;provided_name&quot;: &quot;crucial&quot;,
          &quot;creation_date&quot;: &quot;1659346772973&quot;,
          &quot;analysis&quot;: {
            &quot;analyzer&quot;: {
              &quot;autocomplete&quot;: {
                &quot;filter&quot;: [
                  &quot;lowercase&quot;
                ],
                &quot;tokenizer&quot;: &quot;autocomplete&quot;
              },
              &quot;autocomplete_search&quot;: {
                &quot;filter&quot;: [
                  &quot;lowercase&quot;
                ],
                &quot;tokenizer&quot;: &quot;standard&quot;
              }
            },
            &quot;tokenizer&quot;: {
              &quot;autocomplete&quot;: {
                &quot;type&quot;: &quot;ngram&quot;,
                &quot;min_gram&quot;: &quot;2&quot;,
                &quot;max_gram&quot;: &quot;12&quot;
              }
            }
          },
          &quot;number_of_replicas&quot;: &quot;1&quot;,
          &quot;uuid&quot;: &quot;wo245x3nQaCw3s9e0LSrlA&quot;,
          &quot;version&quot;: {
            &quot;created&quot;: &quot;8030299&quot;
          }
        }
      }
    }
  }
  </code></pre>
  <p>search query:</p>
  <pre><code>GET crucial/_search
  {
    &quot;query&quot;: {
      &quot;bool&quot;: {
        &quot;must&quot;: [
          {
            &quot;match&quot;: {
              &quot;brand_name&quot;: &quot;asus&quot;
            }
          },
          {
            &quot;match&quot;: {
              &quot;name&quot;: &quot;asus x452l&quot;
            }
          }
        ]
      }
    },
    &quot;aggs&quot;: {
      &quot;auto_complete&quot;: {
        &quot;terms&quot;: {
          &quot;field&quot;: &quot;brand_id&quot;,
          &quot;order&quot;: {
            &quot;_count&quot;: &quot;desc&quot;
          }
        }
      }
    }, &quot;size&quot;: 20
  }
  </code></pre>
  <p>output:</p>
  <pre><code>{
    &quot;took&quot;: 2,
    &quot;timed_out&quot;: false,
    &quot;_shards&quot;: {
      &quot;total&quot;: 1,
      &quot;successful&quot;: 1,
      &quot;skipped&quot;: 0,
      &quot;failed&quot;: 0
    },
    &quot;hits&quot;: {
      &quot;total&quot;: {
        &quot;value&quot;: 319,
        &quot;relation&quot;: &quot;eq&quot;
      },
      &quot;max_score&quot;: 13.513464,
      &quot;hits&quot;: [
        {
          &quot;_index&quot;: &quot;crucial&quot;,
          &quot;_id&quot;: &quot;63400&quot;,
          &quot;_score&quot;: 13.513464,
          &quot;_source&quot;: {
            &quot;id&quot;: 63400,
            &quot;name&quot;: &quot;asus x409&quot;,
            &quot;brand_name&quot;: &quot;asus&quot;,
            &quot;brand_id&quot;: 12,
            &quot;category_name&quot;: &quot;x400 series&quot;
          }
        },{
          &quot;_index&quot;: &quot;crucial&quot;,
          &quot;_id&quot;: &quot;63412&quot;,
          &quot;_score&quot;: 13.279591,
          &quot;_source&quot;: {
            &quot;id&quot;: 63412,
            &quot;name&quot;: &quot;asus x452e&quot;,
            &quot;brand_name&quot;: &quot;asus&quot;,
            &quot;brand_id&quot;: 12,
            &quot;category_name&quot;: &quot;x400 series&quot;
          }
        }
      ]
    },
    &quot;aggregations&quot;: {
      &quot;auto_complete&quot;: {
        &quot;doc_count_error_upper_bound&quot;: 0,
        &quot;sum_other_doc_count&quot;: 0,
        &quot;buckets&quot;: [
          {
            &quot;key&quot;: 12,
            &quot;doc_count&quot;: 297
          },
          {
            &quot;key&quot;: 40,
            &quot;doc_count&quot;: 22
          }
        ]
      }
    }
  }
  </code></pre>
  <p>As you can see the search query is &quot;asus x452l&quot; and I expected &quot;asus x452e&quot; to have maximum score but it's not! what is the problem with scoring and how can I fix this?</p>