# Store fields with the same name and type

**URL:** <https://discuss.elastic.co/t/store-fields-with-the-same-name-and-type/94963>\
**Category:** Elasticsearch\
**Created:** [July 28, 2017, 2:03pm UTC](https://discuss.elastic.co/t/store-fields-with-the-same-name-and-type/94963 "2017-07-28T14:03:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tolmach](https://avatars.discourse-cdn.com/v4/letter/t/f4b2a3/32.png) [@tolmach](https://discuss.elastic.co/u/tolmach)\
**Post date:** [July 28, 2017, 2:03pm UTC](https://discuss.elastic.co/t/store-fields-with-the-same-name-and-type/94963/1 "2017-07-28T14:03:18Z")

</div>

I want to search some data by tags.  
Can i store 2 or more fields with the same name and type in document?  
Can i use this mapping for that?  
{  
"properties": {  
"tag": {  
"type": "keyword"  
},  
"origin": {  
"type": "keyword"  
}  
}  
}  
How can i add a new tag to the document and search by them?  
Should i use an array of a tags?  
What is the best way to do that?

---

<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:** [August 25, 2017, 2:03pm UTC](https://discuss.elastic.co/t/store-fields-with-the-same-name-and-type/94963/2 "2017-08-25T14:03:43Z")

</div>

Closed on August 25, 2017, 2:03pm UTC

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