4
votes

I'm having an issue where elasticsearch is returning different results across my environments (staging and production).

The version of elasticsearch I'm using are the same for both environments.

version: { created: 1000199}

The two environments both have identical mapping and index settings.

I have an item indexed with a title field of "test". I am trying to perform a match_phrase_prefix query. Yet, in my staging environment when I just search for "te" the result comes back as expected. In production, I have to extend my search query to "tes" (3 letters) to retrieve the document.

The query I am issuing is a follows:

{
  "query": {
    "match_phrase_prefix": {
      "title": "test"
    }
  },
  "post_filter": {
    "term": {
      "uniqueId": "my_unique_id"
    }
  }
}

The only difference I can see between the two environments are the amount of documents index.

In my staging environment, I have approx. 150k documents index which equates to about 297M.

In production, I have over 120 million documents indexed which equates close to 120gb.

Is this a scale problem, or is there some elasticsearch setting that I am missing. Like I said the mappings and settings are identical across the environments, so I am a bit stumped here.

1

1 Answers

2
votes

I am pretty late, but see my other answer. The problem is max_expansions parameter which is 10 by default.

Your staging environment has less words which start with "te" than production environment and it is able to get test within 10 expansions(alphabetically)