# Search for a file with the ID

**URL:** <https://discuss.elastic.co/t/search-for-a-file-with-the-id/143896>\
**Category:** Elasticsearch\
**Created:** [August 10, 2018, 3:44pm UTC](https://discuss.elastic.co/t/search-for-a-file-with-the-id/143896 "2018-08-10T15:44:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sah](https://avatars.discourse-cdn.com/v4/letter/s/ecc23a/32.png) [@sah](https://discuss.elastic.co/u/sah)\
**Post date:** [August 10, 2018, 3:44pm UTC](https://discuss.elastic.co/t/search-for-a-file-with-the-id/143896/1 "2018-08-10T15:44:42Z")

</div>

I am trying to search for a file with the ID "fe4cec0f-4c57-4371-9828-a8ab01192285"

How would I do that? I suck as elastic ☹

Here is an example what is stored  
contentType":{"name":"Asset"},"createdModifiedBy":[{"userType":0,"id":"fe4cec0f-4c57-4371-9828-a8ab01192285"}

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [August 10, 2018, 4:24pm UTC](https://discuss.elastic.co/t/search-for-a-file-with-the-id/143896/2 "2018-08-10T16:24:55Z")

</div>

It depends on your mapping.

---

<div class="post-metadata">

**Author:** ![sah](https://avatars.discourse-cdn.com/v4/letter/s/ecc23a/32.png) [@sah](https://discuss.elastic.co/u/sah)\
**Post date:** [August 10, 2018, 8:31pm UTC](https://discuss.elastic.co/t/search-for-a-file-with-the-id/143896/3 "2018-08-10T20:31:38Z")

</div>

> [@dadoonet](#):
>
> mapping.

From google, it looks like I can do /\_mapping

This is what I got

```
    "mappings": {
        "UniqueKeyEntry": {
            "properties": {
                "entityId": {
                    "type": "string",
                    "index": "not_analyzed",
                    "doc_values": true
                },
                "fieldId": {
                    "type": "string",
                    "index": "not_analyzed",
                    "doc_values": true
                },
                "fieldValue": {
                    "type": "string",
                    "index": "not_analyzed",
                    "doc_values": true
                },
                "id": {
                    "type": "string",
                    "index": "not_analyzed",
                    "doc_values": true
                }
            }
        },
        "UniqueKeyLookupEntry": {
            "properties": {
                "id": {
                    "type": "string",
                    "index": "not_analyzed",
                    "doc_values": true
                },
                "uniqueKeyEntryId": {
                    "type": "string",
                    "index": "not_analyzed",
                    "doc_values": true
                }
            }
        }
    }
},

```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [August 10, 2018, 9:00pm UTC](https://discuss.elastic.co/t/search-for-a-file-with-the-id/143896/4 "2018-08-10T21:00:18Z")

</div>

Sounds ok (although it's probably an old version).

Could you provide a full recreation script as described in [About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

A full reproduction script will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.

---

<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:** [September 7, 2018, 9:00pm UTC](https://discuss.elastic.co/t/search-for-a-file-with-the-id/143896/5 "2018-09-07T21:00:18Z")

</div>

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