Elasticsearch [6.8.23] does not return results when I query in a specific field

Hi Everyone,

I am running an issue after I upgraded my Elastic Cluster from 5.1.1 to 6.8.23.

When I search everything in an index using this API:

/index_0003/_search

it returns all the result as expected.

However when I search for something it only searches through only one field of the mapping and not the other ones.

Suppose the _source has the following mapping:

"_source": {
              "foo": "FOO_TEST",
              "boo": "BOO_TEST",
              "bar": "BAR_TEST"                   
            }

When i search for BOO_TEST it returns the result. However, If i search BAR_TEST or FOO_TEST it returns nothing. Even If I set the specific field to query to bar or foo and specify "**" (to return everything) it returns nothing. Following is the query. (I doubt the query is faulty since this same query works perfectly with indexes created using 5.1.1 Client)


{
    "from": 0,
    "size": 100,
    "query": {
        "bool": {
            "should": null,
            "disable_coord": true,
            "adjust_pure_negative": true,
            "boost": 1.0,
            "must": [
                {
                    "bool": {
                        "should": [
                            {
                                "query_string": {
                                    "query": "+**",
                                    "fields": ["bar"],
                                    "use_dis_max": true,
                                    "tie_breaker": 1.1,
                                    "default_operator": "or",
                                    "analyzer": "standard",
                                    "auto_generate_phrase_queries": false,
                                    "fuzziness": "AUTO",
                                    "fuzzy_prefix_length": 0,
                                    "fuzzy_max_expansions": 1000,
                                    "phrase_slop": 0,
                                    "escape": false,
                                    "split_on_whitespace": true,
                                    "boost": 1.0
                                }
                            }
                        ],
                        "disable_coord": true,
                        "adjust_pure_negative": true,
                        "boost": 1.0
                    }
                }
            ]
        }
    }

Thanks in advance. :)))

Can you send its mapping too?

The ones I have provided are only "test values" and not the real ones. Thank you for the reply :slight_smile:

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