# Is it possible to fetch multiple keyword value based on single value?

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-fetch-multiple-keyword-value-based-on-single-value/206352>\
**Category:** Elasticsearch\
**Created:** [November 4, 2019, 7:58am UTC](https://discuss.elastic.co/t/is-it-possible-to-fetch-multiple-keyword-value-based-on-single-value/206352 "2019-11-04T07:58:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thilak](https://avatars.discourse-cdn.com/v4/letter/t/4af34b/32.png) [@Thilak](https://discuss.elastic.co/u/Thilak)\
**Post date:** [November 4, 2019, 7:58am UTC](https://discuss.elastic.co/t/is-it-possible-to-fetch-multiple-keyword-value-based-on-single-value/206352/1 "2019-11-04T07:58:51Z")

</div>

Our mapping type for accountNumber is Keyword and Text , We have not applied any tokenizer. But whenever client search for accountNumber they search with all country code [12345, +2312345, + 3412345] .Is it possible to search only with [12345] and fetch all the records along with country code?

---

<div class="post-metadata">

**Author:** ![Glen\_Smith](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/glen_smith/32/111656_2.png) [@Glen\_Smith](https://discuss.elastic.co/u/Glen_Smith)\
**Post date:** [November 4, 2019, 9:10pm UTC](https://discuss.elastic.co/t/is-it-possible-to-fetch-multiple-keyword-value-based-on-single-value/206352/2 "2019-11-04T21:10:28Z")

</div>

You should be able to accomplish this with a [regex](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-regexp-query.html) query. Note the warning about performance. It would generally be better if you created a field with `12345` and another with country code, which would simplify your query and avoid the potential performance impact of regexp.

---

<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:** [December 2, 2019, 9:10pm UTC](https://discuss.elastic.co/t/is-it-possible-to-fetch-multiple-keyword-value-based-on-single-value/206352/3 "2019-12-02T21:10:34Z")

</div>

Closed on December 2, 2019, 9:10pm UTC

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