0

I know that lowercase_expanded_terms is valid in 2.x version and if the same is tried to execute in 8.9v gives "reason": "[query_string] query does not support [lowercase_expanded_terms]".

{
  "size": 1000,
  "query": {
    "bool": {
      "must": [
        {
          "query_string": {
            "query": "*TEST*",
            "fields": [
              "elastic*"
            ],
            "lowercase_expanded_terms": false // query does not support
          }
        }
      ]
    }
  }
}
Ajay Takur
  • 6,079
  • 5
  • 39
  • 55

1 Answers1

1

lowercase_expanded_terms has been removed around5.0.

Instead you should lowercase your tokens at indexing time using a lowercase token filter in your field analyzer or normalizer.

As a result you'll be able to search for *test* instead of the uppercase version *TEST*.

Val
  • 207,596
  • 13
  • 358
  • 360
  • do you have any code snippets? By the way which is preferred to go with the field analyzer or normalizer once the index got created? – Ajay Takur Aug 22 '23 at 18:22
  • it depends on the mapping of your `elastic*` fields. Feel free to update your question with that information – Val Aug 22 '23 at 19:38
  • In my case data is indexed in capital and while I search with upper/lower case from UI at java code I am converting it to upper case and finally hitting to index. – Ajay Takur Aug 29 '23 at 12:24