# Copy \_id to another retrievable field with Query String

**URL:** https://discuss.elastic.co/t/copy--id-to-another-retrievable-field-with-query-string/23086
**Category:** Elasticsearch
**Created:** [April 3, 2015, 3:12pm UTC](https://discuss.elastic.co/t/copy--id-to-another-retrievable-field-with-query-string/23086 "2015-04-03T15:12:23Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![JZ1](https://avatars.discourse-cdn.com/v4/letter/j/958977/32.png) [@JZ1](https://discuss.elastic.co/u/JZ1)
#### Post date: [April 3, 2015, 3:12pm UTC](https://discuss.elastic.co/t/copy--id-to-another-retrievable-field-with-query-string/23086/1 "2015-04-03T15:12:23Z")

</div>

Hi all,

I want to make the \_id searchable/retrievable and copy its value to a field  
defined as "\_ft".

This is my mapping.

{  
"_default_": {  
"dynamic": "true",  
"\_all": {  
"enabled": false  
},  
"\_id" : {  
"index" : "not\_analyzed",  
"store" : true,  
"copy\_to": "\_ft"  
},  
"properties": {  
"document": {  
"properties": {  
"\_ft": {  
"type": "string",  
"analyzer": "icu"  
}  
}  
}  
}

However, I noticed that after applying this mapping, the \_id is still not  
searchable.

To be clear, I want to use the Query String mode to search in the \_ids as  
well.

Is this possible and how should my mapping look like in order to support  
this?

Cheers,  
/JZ

--  
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/62d79125-a04a-4314-b3b2-d32b7b5b9ca7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/62d79125-a04a-4314-b3b2-d32b7b5b9ca7%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![vineeth\_mohan\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vineeth_mohan_2/32/747_2.png) [@vineeth\_mohan\_2](https://discuss.elastic.co/u/vineeth_mohan_2)
#### Post date: [April 6, 2015, 6:55am UTC](https://discuss.elastic.co/t/copy--id-to-another-retrievable-field-with-query-string/23086/2 "2015-04-06T06:55:25Z")

</div>

Hello ,

There is a ids query , that might be helpful here.

LINK -

> **[IDs | Elasticsearch Guide \[8.11\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-ids-query.html)**

Also a direct query on \_id is working for me -

{  
"query": {  
"query\_string": {  
"query": "\_id:1116275896960111667sdsd7328349520"  
}  
}  
}

Thanks  
Vineeth Mohan,  
Elasticsearch consultant,  
[qbox.io](http://qbox.io) ( Elasticsearch service provider [http://qbox.io/](http://qbox.io/))

On Fri, Apr 3, 2015 at 8:42 PM, [zhangjunte@gmail.com](mailto:zhangjunte@gmail.com) wrote:

> Hi all,
> 
> I want to make the \_id searchable/retrievable and copy its value to a  
> field defined as "\_ft".
> 
> This is my mapping.
> 
> {  
> "_default_": {  
> "dynamic": "true",  
> "\_all": {  
> "enabled": false  
> },  
> "\_id" : {  
> "index" : "not\_analyzed",  
> "store" : true,  
> "copy\_to": "\_ft"  
> },  
> "properties": {  
> "document": {  
> "properties": {  
> "\_ft": {  
> "type": "string",  
> "analyzer": "icu"  
> }  
> }  
> }  
> }
> 
> However, I noticed that after applying this mapping, the \_id is still not  
> searchable.
> 
> To be clear, I want to use the Query String mode to search in the \_ids as  
> well.
> 
> Is this possible and how should my mapping look like in order to support  
> this?
> 
> Cheers,  
> /JZ
> 
> --  
> 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/62d79125-a04a-4314-b3b2-d32b7b5b9ca7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/62d79125-a04a-4314-b3b2-d32b7b5b9ca7%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/62d79125-a04a-4314-b3b2-d32b7b5b9ca7%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/62d79125-a04a-4314-b3b2-d32b7b5b9ca7%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CAGdPd5mk0xrzAdkuRyeP6\_n6nYearPccOECcpUo2uB\_6pJwpPg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGdPd5mk0xrzAdkuRyeP6_n6nYearPccOECcpUo2uB_6pJwpPg%40mail.gmail.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, 12:21am UTC](https://discuss.elastic.co/t/copy--id-to-another-retrievable-field-with-query-string/23086/3 "2017-07-06T00:21:34Z")

</div>


