# Ingest attachment - missing attachment field in results

**URL:** https://discuss.elastic.co/t/ingest-attachment-missing-attachment-field-in-results/103656
**Category:** Elasticsearch
**Created:** [October 12, 2017, 7:04am UTC](https://discuss.elastic.co/t/ingest-attachment-missing-attachment-field-in-results/103656 "2017-10-12T07:04:24Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Shawn\_Mullen\_2](https://avatars.discourse-cdn.com/v4/letter/s/13edae/32.png) [@Shawn\_Mullen\_2](https://discuss.elastic.co/u/Shawn_Mullen_2)
#### Post date: [October 12, 2017, 7:04am UTC](https://discuss.elastic.co/t/ingest-attachment-missing-attachment-field-in-results/103656/1 "2017-10-12T07:04:24Z")

</div>

I have read everything I could find but I have not been able to get the ingest attachment plugin to work. I am using the mapping below:

```auto
{
  "settings": {
    "analysis": {
      "analyzer": {
        "lower_keyword_analyzer": {
          "type": "custom",
          "tokenizer": "keyword",
          "char_filter": [
            "html_strip"
          ],
          "filter": [
            "lowercase"
          ]
        }
      },
      "char_filter":{
        "punc_filter":{
          "type":"mapping",
          "mappings":[
            "- => ",
            ", => ",
            "( => ",
            ") => ",
            "' => ",
            "[ => ",
            "] => ",
            "\" => ",
            "$ => ",
            "& => ",
            ": => ",
            "; => ",
            ". => ",
            "* => ",
            "= => ",
            "+ => ",
            "^ => ",
            "% => ",
            "# => ",
            "@ => ",
            "! => ",
            "~ => ",
            "? => "
            ]
        }
      },
      "normalizer":{
        "sortnormalizer":{
          "type":"custom",
          "char_filter":["punc_filter"],
          "filter": ["lowercase"]
        }
      }
    }
  },
  "mappings":{
        "my_document":{
            "_all":{"enabled":false},
            "properties": {
                "collection_identifier":
                {
                   "type":"keyword"
                },
                "document_file_name":
                {
                   "type":"text",
                   "analyzer":"lower_keyword_analyzer"
                },
                "document_type":
                {
                   "type":"keyword"
                },
                "document_title":
                {
                   "type":"text",
                   "analyzer":"lower_keyword_analyzer",
                   "fields":{
                     "sort":{
                       "type":"keyword",
                       "normalizer": "sortnormalizer"
                     },
                     "case_sensitive":{
                       "type":"keyword"
                     }
                   }
                },
                "attachment":{
                  "properties":{
                    "content": {"type":"text","store": true}
                  }
                },
                "document_categories":
                {
                   "type":"text",
                   "analyzer":"lower_keyword_analyzer"
                 },
                 "document_tags":
                 {
                    "type":"text",
                    "analyzer":"standard"
                  },
                "document_created_at":
                {
                   "type":"date",
                   "format":"epoch_millis"
                },
                "document_update_at":
                {
                   "type":"date",
                   "format":"epoch_millis"
                },
                "data":{
                  "type":"text"
                }
            }
        }
  }
}

```

I have configured the pipeline using:

```auto
{
              "description" : "Extract attachment information",
              "processors" : [
                {
                  "attachment" : {
                    "field" : "data",
                    "indexed_chars": -1,
                    "properties":["content"]
                  }
                }
              ]
            }

```

I am using the bulk api. I am using NodeJS. After indexing (no errors returned) and I do a search (GET - /\_search), the results include the base64 encoded data but there is no attachment field in the results. I must be missing something because no one else seems to be having this issue. Any ideas?

---

<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: [October 12, 2017, 7:29am UTC](https://discuss.elastic.co/t/ingest-attachment-missing-attachment-field-in-results/103656/2 "2017-10-12T07:29:08Z")

</div>

Could you share a typical document you are sending?

---

<div class="post-metadata">

### Author: ![Shawn\_Mullen\_2](https://avatars.discourse-cdn.com/v4/letter/s/13edae/32.png) [@Shawn\_Mullen\_2](https://discuss.elastic.co/u/Shawn_Mullen_2)
#### Post date: [October 12, 2017, 8:15am UTC](https://discuss.elastic.co/t/ingest-attachment-missing-attachment-field-in-results/103656/3 "2017-10-12T08:15:03Z")

</div>

```auto
{"document_identifiers":["1582-09-8"],"collection_identifier":"1","document_file_name":"actadmission.pdf","document_type":"pdf","document_title":"TRIFLURALIN","document_categories":["Hazard Assessment/Summary Document(s)"],"document_tags":["1582-09-8"],"document_created_at":1223683200000,"document_updated_at":1467465970727,"data":"[BASE64 ENCODED PDF DATA]"}

```

---

<div class="post-metadata">

### Author: ![Shawn\_Mullen\_2](https://avatars.discourse-cdn.com/v4/letter/s/13edae/32.png) [@Shawn\_Mullen\_2](https://discuss.elastic.co/u/Shawn_Mullen_2)
#### Post date: [October 12, 2017, 12:03pm UTC](https://discuss.elastic.co/t/ingest-attachment-missing-attachment-field-in-results/103656/4 "2017-10-12T12:03:25Z")

</div>

ok, well, i feel a bit stupid but i figured out the issue. Like I said I am using the bulk api. However, I was submitting the documents as "update" instead instead of "index".

---

<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: [November 9, 2017, 12:03pm UTC](https://discuss.elastic.co/t/ingest-attachment-missing-attachment-field-in-results/103656/5 "2017-11-09T12:03:52Z")

</div>

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