# Terms Query Lookup with index on another cluster

**URL:** <https://discuss.elastic.co/t/terms-query-lookup-with-index-on-another-cluster/119313>\
**Category:** Elasticsearch\
**Created:** [February 9, 2018, 10:41pm UTC](https://discuss.elastic.co/t/terms-query-lookup-with-index-on-another-cluster/119313 "2018-02-09T22:41:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![apang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/apang/32/22400_2.png) [@apang](https://discuss.elastic.co/u/apang)\
**Post date:** [February 9, 2018, 10:41pm UTC](https://discuss.elastic.co/t/terms-query-lookup-with-index-on-another-cluster/119313/1 "2018-02-09T22:41:54Z")

</div>

Running Elasticsearch 6.2.0.  
I can query values in the remote lookup index just fine, but I can't seem to use it in terms query.  
Ex.

```
GET RemoteCluster:lookup/_search
{
  "query": {
    "match_all": {}
  }
}

GET RemoteCluster:normal_index/_search
{
  "query": {
    "terms": {
      "myField": {
        "index": "RemoteCluster:lookup",
        "type": "_doc",
        "id": "myId",
        "path": "myPath"
      }
    }
  },
  "size": 10
}

```

Response:

```
{
  "error": {
    "root_cause": [
      {
        "type": "index_not_found_exception",
        "reason": "no such index",
        "resource.type": "index_expression",
        "resource.id": "RemoteCluster:lookup",
        "index_uuid": "_na_",
        "index": "RemoteCluster:lookup"
      }
    ],
    "type": "index_not_found_exception",
    "reason": "no such index",
    "resource.type": "index_expression",
    "resource.id": "RemoteCluster:lookup",
    "index_uuid": "_na_",
    "index": "RemoteCluster:lookup"
  },
  "status": 404
}

```

If I do the query directly on the cluster RemoteCluster it works fine.  
Ex.

```
GET normal_index/_search
{
  "query": {
    "terms": {
      "myField": {
        "index": "lookup",
        "type": "_doc",
        "id": "myId",
        "path": "myPath"
      }
    }
  },
  "size": 10
}

```

Is this a bug with terms query lookup or just not possible?

---

<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 9, 2018, 10:42pm UTC](https://discuss.elastic.co/t/terms-query-lookup-with-index-on-another-cluster/119313/2 "2018-03-09T22:42:02Z")

</div>

Closed on March 9, 2018, 10:42pm UTC

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