# Terms filter lookup example not working

**URL:** <https://discuss.elastic.co/t/terms-filter-lookup-example-not-working/2224>\
**Category:** Elasticsearch\
**Created:** [June 9, 2015, 1:42pm UTC](https://discuss.elastic.co/t/terms-filter-lookup-example-not-working/2224 "2015-06-09T13:42:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![orweinberger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/orweinberger/32/580_2.png) [@orweinberger](https://discuss.elastic.co/u/orweinberger)\
**Post date:** [June 9, 2015, 1:42pm UTC](https://discuss.elastic.co/t/terms-filter-lookup-example-not-working/2224/1 "2015-06-09T13:42:42Z")

</div>

Hi,

Running the latest version (1.5.2) and following this topic: [https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-terms-filter.html#\_terms\_lookup\_twitter\_example](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-terms-filter.html#_terms_lookup_twitter_example)

However, even though I'm doing everything exactly as it says in the example, I'm getting 0 hits:

```auto
{
    "took": 1,
    "timed_out": false,
    "_shards": {
        "total": 1,
        "successful": 1,
        "failed": 0
    },
    "hits": {
        "total": 0,
        "max_score": null,
        "hits": []
    }
}

```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 10, 2015, 3:28am UTC](https://discuss.elastic.co/t/terms-filter-lookup-example-not-working/2224/2 "2015-06-10T03:28:59Z")

</div>

That's right, because you only have a tweet belonging to user 2 and that user only follows users 1 and 3 and not themselves. So if you ask for all tweets for users that user 2 follows, ie user 1 and 3, it won't return anything.

It just illustrates that the query will create a filter that ignores that tweet.

If you did;

```auto
$ curl -XPUT localhost:9200/tweets/tweet/2 -d '{
   "user" : "1"
}'

```

And then rerun that query, you will get a result as it matches the filter.

---

<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 6, 2017, 12:08am UTC](https://discuss.elastic.co/t/terms-filter-lookup-example-not-working/2224/3 "2017-07-06T00:08:42Z")

</div>


