# Help on using stored filed in side a query

**URL:** <https://discuss.elastic.co/t/help-on-using-stored-filed-in-side-a-query/330825>\
**Category:** Elasticsearch\
**Created:** [April 26, 2023, 10:59am UTC](https://discuss.elastic.co/t/help-on-using-stored-filed-in-side-a-query/330825 "2023-04-26T10:59:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sreekanth\_makam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sreekanth_makam/32/120241_2.png) [@sreekanth\_makam](https://discuss.elastic.co/u/sreekanth_makam)\
**Post date:** [April 26, 2023, 10:59am UTC](https://discuss.elastic.co/t/help-on-using-stored-filed-in-side-a-query/330825/1 "2023-04-26T10:59:46Z")

</div>

I have index1 and index2. Running below query against Index1 where i point to index2. In indexs those fields created with stored option. Please help on this query.

```auto
POST /Index1/_search
{
    "query": {
        "bool": {
            "filter": [
                {
			"terms" : {
			"PID" : {
			     "index" : "Index2",
				  "type" : "_doc",
				  "id" : "1123",
				  "path" : "field1",
				  "stored": true
				}
			}
		}
    ]
  }
 }
}

```

**ERROR** : :{"type":"x\_content\_parse\_exception","reason":"[12:17] [terms\_lookup] unknown field [stored]"}

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [April 26, 2023, 11:08am UTC](https://discuss.elastic.co/t/help-on-using-stored-filed-in-side-a-query/330825/2 "2023-04-26T11:08:44Z")

</div>

That sounds a lot like a join, which Elasticsearch generally do not support.

What does the data in the two indices look like and how are you looking to merge them?

---

<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:** [May 24, 2023, 11:09am UTC](https://discuss.elastic.co/t/help-on-using-stored-filed-in-side-a-query/330825/3 "2023-05-24T11:09:16Z")

</div>

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