# Why return error result when use \_routing field?

**URL:** <https://discuss.elastic.co/t/why-return-error-result-when-use--routing-field/62896>\
**Category:** Elasticsearch\
**Created:** [October 13, 2016, 6:10am UTC](https://discuss.elastic.co/t/why-return-error-result-when-use--routing-field/62896 "2016-10-13T06:10:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![famoss](https://avatars.discourse-cdn.com/v4/letter/f/67e7ee/32.png) [@famoss](https://discuss.elastic.co/u/famoss)\
**Post date:** [October 13, 2016, 6:10am UTC](https://discuss.elastic.co/t/why-return-error-result-when-use--routing-field/62896/1 "2016-10-13T06:10:28Z")

</div>

Such as url `index-0/_search?routing=24320`,i search data from `24230` `routing`,but the result is

```
"_index": "index-0",
"_type": "member",
"_id": "40865630",
"_score": 1,
"_routing": "22500",

```

Why `22500` match the search condition?

---

<div class="post-metadata">

**Author:** ![wanglifengwf](https://avatars.discourse-cdn.com/v4/letter/w/41988e/32.png) [@wanglifengwf](https://discuss.elastic.co/u/wanglifengwf)\
**Post date:** [October 13, 2016, 6:16am UTC](https://discuss.elastic.co/t/why-return-error-result-when-use--routing-field/62896/2 "2016-10-13T06:16:12Z")

</div>

you can use this instead:

```auto
POST index/_search
{
  "query": {
    "term": {
      "_routing": {
        "value": "VALUE"
      }
    }
  }
}

```

---

<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, 10:12pm UTC](https://discuss.elastic.co/t/why-return-error-result-when-use--routing-field/62896/3 "2017-07-05T22:12:46Z")

</div>

Closed on July 5, 2017, 10:12pm UTC


