# Search on "copy\_to"-"keyword" Field and Get/View indexed data of the "copy\_to"-"keyword"-Field (not "\_source")

**URL:** <https://discuss.elastic.co/t/search-on-copy-to-keyword-field-and-get-view-indexed-data-of-the-copy-to-keyword-field-not-source/216419>\
**Category:** Elasticsearch\
**Created:** [January 24, 2020, 12:48pm UTC](https://discuss.elastic.co/t/search-on-copy-to-keyword-field-and-get-view-indexed-data-of-the-copy-to-keyword-field-not-source/216419 "2020-01-24T12:48:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mero](https://avatars.discourse-cdn.com/v4/letter/m/e68b1a/32.png) [@mero](https://discuss.elastic.co/u/mero)\
**Post date:** [January 24, 2020, 12:48pm UTC](https://discuss.elastic.co/t/search-on-copy-to-keyword-field-and-get-view-indexed-data-of-the-copy-to-keyword-field-not-source/216419/1 "2020-01-24T12:48:47Z")

</div>

Hi together,  
is there a possibility to see or view the indexed data stored in an elasticsearch index?

I have a Field which is filled by using "copy\_to" of other Fields ("Keyword") and now i have a query that is not finding the results.

To understand what could bee a possible cause i would like to see the stored data.

I have got a simple Example:

```
DELETE abc_test

PUT abc_test
{
  "mappings": {
    "properties": {
      "test": {
        "properties": {
          "abc": {
            "type": "keyword",
            "copy_to": "combi"
          },
          "xyz": {
            "type": "keyword",
            "copy_to": "combi"
          },
          "combi": {
            "type": "keyword",
            "store" : true
          }
        }
      }
    }
  }
}

POST abc_test/_doc
{
  "test": [
    {
      "abc": "1",
      "xyz": "2"
    },
    {
      "abc": "2",
      "xyz": "3"
    },
    {
      "abc": "4",
      "xyz": "1"
    }
  ]
}

POST abc_test/_doc
{
  "test": [
    {
      "abc": "1",
      "xyz": "6"
    },
    {
      "abc": "7",
      "xyz": "8"
    },
    {
      "abc": "4",
      "xyz": "0"
    }
  ]
}

GET abc_test/_search
{
  "stored_fields": ["test.combi"]
}

GET abc_test/_search
{
  "query": {
    "match_all": {}
  }
}

GET abc_test/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "match": {
            "test.combi": "{what must i search here to finde one stored document?}"
          }
        }
      ]
    }
  }
}

```

Edit: I've try the store ([https://www.elastic.co/guide/en/elasticsearch/reference/7.5/mapping-store.html#mapping-store](https://www.elastic.co/guide/en/elasticsearch/reference/7.5/mapping-store.html#mapping-store)) but with that i dont see more.

---

<div class="post-metadata">

**Author:** ![mero](https://avatars.discourse-cdn.com/v4/letter/m/e68b1a/32.png) [@mero](https://discuss.elastic.co/u/mero)\
**Post date:** [January 24, 2020, 4:22pm UTC](https://discuss.elastic.co/t/search-on-copy-to-keyword-field-and-get-view-indexed-data-of-the-copy-to-keyword-field-not-source/216419/2 "2020-01-24T16:22:45Z")

</div>

OK, i have got the problem...

It was the mapping.  
RIGHT:

> "copy\_to": "test.combi"

FALSE:

> "copy\_to": "combi"

Full mapping that works:

```
PUT abc_test
    {
      "mappings": {
        "properties": {
          "test": {
            "properties": {
              "abc": {
                "type": "keyword",
                "copy_to": "test.combi"
              },
              "xyz": {
                "type": "keyword",
                "copy_to": "test.combi"
              },
              "combi": {
                "type": "keyword",
                "store" : true
              }
            }
          }
        }
      }
    }

```

---

<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:** [February 21, 2020, 4:35pm UTC](https://discuss.elastic.co/t/search-on-copy-to-keyword-field-and-get-view-indexed-data-of-the-copy-to-keyword-field-not-source/216419/3 "2020-02-21T16:35:57Z")

</div>

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