# Filter range not working

**URL:** <https://discuss.elastic.co/t/filter-range-not-working/34748>\
**Category:** Elasticsearch\
**Created:** [November 17, 2015, 12:29am UTC](https://discuss.elastic.co/t/filter-range-not-working/34748 "2015-11-17T00:29:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luongvancong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/luongvancong/32/5966_2.png) [@luongvancong](https://discuss.elastic.co/u/luongvancong)\
**Post date:** [November 17, 2015, 12:29am UTC](https://discuss.elastic.co/t/filter-range-not-working/34748/1 "2015-11-17T00:29:03Z")

</div>

My data has products with price \>= 500000 and price \<= 10000000. But result search is zero. I don't know. What is my problem? . Please help me.

This is my params.

```php

Array
(
    [index] => nht-test
    [type] => products
    [from] => 0
    [size] => 24
    [body] => Array
        (
            [query] => Array
                (
                    [filtered] => Array
                        (
                            [query] => Array
                                (
                                    [match] => Array
                                        (
                                            [brand] => apple
                                        )

                                )

                            [filter] => Array
                                (
                                    [range] => Array
                                        (
                                            [price] => Array
                                                (
                                                    [gte] => 500000
                                                    [lte] => 10000000
                                                )

                                        )

                                )

                        )

                )

        )

)

```

And result:

```php

Array
(
    [took] => 3
    [timed_out] => 
    [_shards] => Array
        (
            [total] => 5
            [successful] => 5
            [failed] => 0
        )

    [hits] => Array
        (
            [total] => 0
            [max_score] => 
            [hits] => Array
                (
                )

        )

)

```

---

<div class="post-metadata">

**Author:** ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)\
**Post date:** [November 18, 2015, 3:34pm UTC](https://discuss.elastic.co/t/filter-range-not-working/34748/2 "2015-11-18T15:34:24Z")

</div>

Does the `match` query alone return any document? You could also try to change that part to `match_all` and see if the filter works and then start narrowing down the problem.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 11:37pm UTC](https://discuss.elastic.co/t/filter-range-not-working/34748/3 "2017-07-05T23:37:34Z")

</div>


