# Terms lookup with range?

**URL:** https://discuss.elastic.co/t/terms-lookup-with-range/87169
**Category:** Elasticsearch
**Created:** [May 25, 2017, 6:51pm UTC](https://discuss.elastic.co/t/terms-lookup-with-range/87169 "2017-05-25T18:51:07Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jimyoo](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jimyoo](https://discuss.elastic.co/u/jimyoo)
#### Post date: [May 25, 2017, 6:51pm UTC](https://discuss.elastic.co/t/terms-lookup-with-range/87169/1 "2017-05-25T18:51:07Z")

</div>

I want a query like "is this IP address belong to addresses from the table?". And the table can have individual addresses, ranges (e.g, 192.168.10.2 - 192.168.10.102), and/or mask (e.g, 192.168.10.0/28) with lots of those.  
Can I use "terms query with lookup" for this? Then how? If not, what'd be the best way to archive this?  
Thanks in advance.

---

<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: [June 22, 2017, 6:51pm UTC](https://discuss.elastic.co/t/terms-lookup-with-range/87169/2 "2017-06-22T18:51:14Z")

</div>

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