# Not Able to search data from the ingested PDF

**URL:** <https://discuss.elastic.co/t/not-able-to-search-data-from-the-ingested-pdf/145723>\
**Category:** Elasticsearch\
**Created:** [August 23, 2018, 12:34pm UTC](https://discuss.elastic.co/t/not-able-to-search-data-from-the-ingested-pdf/145723 "2018-08-23T12:34:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![manish\_kakoti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manish_kakoti/32/53285_2.png) [@manish\_kakoti](https://discuss.elastic.co/u/manish_kakoti)\
**Post date:** [August 23, 2018, 12:34pm UTC](https://discuss.elastic.co/t/not-able-to-search-data-from-the-ingested-pdf/145723/1 "2018-08-23T12:34:45Z")

</div>

I am using nodejs client (elasticsearch.js) .

I have ingested a PDF into elasticsearch using mapper attachment plugin. .The ingestion was successful. Whenever i am trying to search data from the document (already ingested), nothing is returned.

Here is my code sample:

```auto
var fs = require('fs');
var content = fs.readFileSync('DATA', 'utf8');

var base64 = new Buffer(content).toString('base64');

client.create({
    index: 'files',
    type: 'document',
    body: {
        file_id: '1',
        file: {
            _content: base64
        }
    }
})
.catch((err) => {
    console.error('Error while creating elasticsearch record', err);
});

```

search.js

```auto
client.search({
    index: 'files',
    type: 'document',
    body: {
        query: {
            match: {
                message: "makes it easy and affordable"
            }
         }
    }
}, function(error, resp, status){
    console.log("----SEARCH----");
    if (error) {
        console.log(error);
    }
    console.log(JSON.stringify(resp) + " : SEARCH");
    console.log(status);
});

```

The search.js returns

```auto
----SEARCH----
{"took":1,"timed_out":false,"_shards":{"total":5,"successful":5,"skipped":0,"failed":0},"hits":{"total":0,"max_score":nu
ll,"hits":[]}} : SEARCH
200

```

I am a newbie with elastic, can someone guide me to what am i missing here

---

<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 23, 2018, 12:48pm UTC](https://discuss.elastic.co/t/not-able-to-search-data-from-the-ingested-pdf/145723/2 "2018-08-23T12:48:34Z")

</div>

Mapper attachments plugin has been removed now. Please use ingest attachment processor instead.

See [https://www.elastic.co/guide/en/elasticsearch/plugins/6.3/ingest-attachment.html](https://www.elastic.co/guide/en/elasticsearch/plugins/6.3/ingest-attachment.html)

---

<div class="post-metadata">

**Author:** ![manish\_kakoti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manish_kakoti/32/53285_2.png) [@manish\_kakoti](https://discuss.elastic.co/u/manish_kakoti)\
**Post date:** [August 23, 2018, 12:58pm UTC](https://discuss.elastic.co/t/not-able-to-search-data-from-the-ingested-pdf/145723/3 "2018-08-23T12:58:15Z")

</div>

I tried with ingest attachment too, but still getting the same result, is there any error with the query if you can check @dadoonet

---

<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 23, 2018, 2:02pm UTC](https://discuss.elastic.co/t/not-able-to-search-data-from-the-ingested-pdf/145723/4 "2018-08-23T14:02:48Z")

</div>

What does look like a document you have indexed with ingest-attachment?

---

<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 20, 2018, 2:02pm UTC](https://discuss.elastic.co/t/not-able-to-search-data-from-the-ingested-pdf/145723/5 "2018-09-20T14:02:52Z")

</div>

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