# Range Search with "TO"keyword

**URL:** <https://discuss.elastic.co/t/range-search-with-to-keyword/74736>\
**Category:** Elasticsearch\
**Created:** [February 11, 2017, 2:25am UTC](https://discuss.elastic.co/t/range-search-with-to-keyword/74736 "2017-02-11T02:25:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manvir\_Basra](https://avatars.discourse-cdn.com/v4/letter/m/e95f7d/32.png) [@Manvir\_Basra](https://discuss.elastic.co/u/Manvir_Basra)\
**Post date:** [February 11, 2017, 2:25am UTC](https://discuss.elastic.co/t/range-search-with-to-keyword/74736/1 "2017-02-11T02:25:57Z")

</div>

Is there any way to make following data searchable if query contains "Street 11"? Please note that there is AND operator means "Street" and "11" both should be in document

Street 9 TO 13

---

<div class="post-metadata">

**Author:** ![Babadofar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/babadofar/32/44803_2.png) [@Babadofar](https://discuss.elastic.co/u/Babadofar)\
**Post date:** [February 11, 2017, 9:23am UTC](https://discuss.elastic.co/t/range-search-with-to-keyword/74736/2 "2017-02-11T09:23:41Z")

</div>

You could put street name and number into separate fields.  
On querying, detect if the user typed in a street name, split the query into two parts, one using a match query for the street name, the other using a range query on the street number.  
Perhaps not very easy, but possible.

---

<div class="post-metadata">

**Author:** ![Manvir\_Basra](https://avatars.discourse-cdn.com/v4/letter/m/e95f7d/32.png) [@Manvir\_Basra](https://discuss.elastic.co/u/Manvir_Basra)\
**Post date:** [February 12, 2017, 1:06am UTC](https://discuss.elastic.co/t/range-search-with-to-keyword/74736/3 "2017-02-12T01:06:21Z")

</div>

Thanks!

Street values are not numbers all the time so range query doesn't seem possible  
e.g.  
Street A To D  
Street S, N, 6B, U9

I was thinking to create bigrams for these special words  
e.g.  
Street S, N, 6B, U9, 8 TO 10  
will have tokens like  
Street S  
Street N  
Street 6B  
Street U9  
Street 8  
Street 9  
Street 10

Any ideas how this can be achieved?

---

<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:** [March 12, 2017, 1:06am UTC](https://discuss.elastic.co/t/range-search-with-to-keyword/74736/4 "2017-03-12T01:06:45Z")

</div>

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