# Return search results fields by a mapping document using ElasticSearch

**URL:** <https://discuss.elastic.co/t/return-search-results-fields-by-a-mapping-document-using-elasticsearch/18249>\
**Category:** Elasticsearch\
**Created:** [June 22, 2014, 4:30pm UTC](https://discuss.elastic.co/t/return-search-results-fields-by-a-mapping-document-using-elasticsearch/18249 "2014-06-22T16:30:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rayman\_2](https://avatars.discourse-cdn.com/v4/letter/r/3bc359/32.png) [@rayman\_2](https://discuss.elastic.co/u/rayman_2)\
**Post date:** [June 22, 2014, 4:30pm UTC](https://discuss.elastic.co/t/return-search-results-fields-by-a-mapping-document-using-elasticsearch/18249/1 "2014-06-22T16:30:23Z")

</div>

I am indexing the following document as follows:

```
{
            "_index": "transactions",
            "_type": "transaction",
            "_id": "1",
            "_score": 1,
            "_source": {
               "title": "another backup",
               "action": "3"
            }
         }

```

Now let's assume I have a another static document which holds all mappings  
for the actions:

```
{
            "_index": "transactions",
            "_type": "actions",
            "_id": "1",
            "_score": 1,
            "_source": {
               "3": "backup",
               "2": "upload",
               "1": "AnotherAction"
            }
         },

```

1. Is it possible to configure ES so when it returns document of type:  
/transactions/transaction/?

It will map the action field value into the value which stored at  
transactions/actions/1 ?

So when I do `GET /transactions/transaction/_search`

Ill get something like this:

```
{
                "_index": "transactions",
                "_type": "transaction",
                "_id": "1",
                "_score": 1,
                "_source": {
                   "title": "another backup",
                   "action": "backup"
                }
             }

```

If it's possible how I do that? if not what other way is possible to index  
such documents with properties values as "enums" while knowing that their  
values might change in the future.

thanks,  
ray.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/082f53b0-6e34-4979-8024-3274b43de9f8%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/082f53b0-6e34-4979-8024-3274b43de9f8%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:20am UTC](https://discuss.elastic.co/t/return-search-results-fields-by-a-mapping-document-using-elasticsearch/18249/2 "2017-07-06T01:20:43Z")

</div>


