[bool] query does not support [range]

Dear Team,

I am working on to filter record with match + range filter, but its throw following issue "[bool] query does not support [range]"

What I did:

    Array
    (
        [index] => index_name
        [type] => type_name
        [from] => 0
        [size] => 20
        [body] => Array
            (
                [query] => Array
                    (
                        [bool] => Array
                            (
                                [should] => Array
                                    (
                                        [0] => Array
                                            (
                                                [match] => Array
                                                    (
                                                        [field1.field2.keyword] => awdweqweqwe
                                                    )

                                            )

                                        [1] => Array
                                            (
                                                [match] => Array
                                                    (
                                                        [field3] => 
                                                    )

                                            )

                                        [2] => Array
                                            (
                                                [match] => Array
                                                    (
                                                        [field3] => data
                                                    )

                                            )

                                        [3] => Array
                                            (
                                                [match] => Array
                                                    (
                                                        [field4] => 201
                                                    )

                                            )

                                    )

                                [range] => Array
                                    (
                                        [status] => Array
                                            (
                                                [gte] => 201
                                                [lte] => 1000
                                            )

                                    )

                            )

                    )

                [sort] => Array
                    (
                        [0] => Array
                            (
                                [updated_date] => Array
                                    (
                                        [order] => desc
                                    )

                            )

                    )

            )

    )

Please suggest me, How to get range with match search data.

Thanks in advance

range should be in the should array or in a must array depending on what you want to do.
Read more on Bool query here: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html

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