# Ingest Attachment plugin not working with WPD files

**URL:** <https://discuss.elastic.co/t/ingest-attachment-plugin-not-working-with-wpd-files/200721>\
**Category:** Elasticsearch\
**Created:** [September 23, 2019, 3:38pm UTC](https://discuss.elastic.co/t/ingest-attachment-plugin-not-working-with-wpd-files/200721 "2019-09-23T15:38:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamesfaix](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jamesfaix/32/61577_2.png) [@jamesfaix](https://discuss.elastic.co/u/jamesfaix)\
**Post date:** [September 23, 2019, 3:38pm UTC](https://discuss.elastic.co/t/ingest-attachment-plugin-not-working-with-wpd-files/200721/1 "2019-09-23T15:38:47Z")

</div>

I am trying to index files of various formats as documents in Elasticsearch 7.1, and extract their text using the Ingest Attachment plugin. I am using Amazon's managed Elasticsearch service.

This has been working great for many formats, but it seems to not work for WPD (WordPerfect) files. When I try to insert a WordPerfect file, the Ingest Attachment plugin will not add the attachment fields to my document, but it will also not throw an error.

Here is a link to a C# project where I am setting up the pipeline. [https://github.com/JamesFaix/es-indexer/blob/master/es-indexer/EsService.cs#L72](https://github.com/JamesFaix/es-indexer/blob/master/es-indexer/EsService.cs#L72) This project won't work locally because of security restrictions on the AWS instance it is pointing to, but it should work on any blank ES 7 instance.

In JSON, the pipeline declaration looks like this:

```
{
  "description": "This is a pipeline!",
  "processors": [
    {
      "attachment: {
        "field": "data",
        "properties": [
          "content"
        ]
      }
    },
    {
      "gsub": {
        "field": "attachment.content",
        "pattern": @"\s+",
        "replacement": " "
      }
    }
  ],
  "on_failure": [
    {
      "set": {
        "field": "error",
        "value": "Text extraction failed ({{ _ingest.on_failure_message }})"
      }
    },
    {
      "set": {
        "field": "attachment.content",
        "value": ""
      }
    }
  }
}

```

What I am seeing is that if I just run the Attachment plugin on a WPD file, no error is thrown and the `attachment.content` field is never assigned to on the document. Since I am using GSUB after that, it will error because the field it is trying to read from is not there.

If I use a DOCX, PDF, or several other formats, both plugins work fine.

This could be an issue with the Attachment plugin or Tika, I'm not sure. The Tika documentation does say it supports WordPerfect and other Corel formats.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [September 24, 2019, 8:52am UTC](https://discuss.elastic.co/t/ingest-attachment-plugin-not-working-with-wpd-files/200721/2 "2019-09-24T08:52:20Z")

</div>

you could try the tika commandline tool and see if that works on your file.

See [https://tika.apache.org/1.20/gettingstarted.html](https://tika.apache.org/1.20/gettingstarted.html)

---

<div class="post-metadata">

**Author:** ![jamesfaix](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jamesfaix/32/61577_2.png) [@jamesfaix](https://discuss.elastic.co/u/jamesfaix)\
**Post date:** [September 25, 2019, 2:23pm UTC](https://discuss.elastic.co/t/ingest-attachment-plugin-not-working-with-wpd-files/200721/3 "2019-09-25T14:23:36Z")

</div>

I tried creating a small test project in Java locally using Tika and it required an extra library org.apache.tika.parsers.wordPerfectParser. Perhaps this is missing in the Ingest Attachment plugin.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [September 25, 2019, 2:33pm UTC](https://discuss.elastic.co/t/ingest-attachment-plugin-not-working-with-wpd-files/200721/4 "2019-09-25T14:33:05Z")

</div>

If that library is not listed here in the dependencies at [https://github.com/elastic/elasticsearch/blob/master/plugins/ingest-attachment/build.gradle#L25-L71](https://github.com/elastic/elasticsearch/blob/master/plugins/ingest-attachment/build.gradle#L25-L71) - it's likely that this will be culprit.

---

<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:** [October 23, 2019, 2:33pm UTC](https://discuss.elastic.co/t/ingest-attachment-plugin-not-working-with-wpd-files/200721/5 "2019-10-23T14:33:09Z")

</div>

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