# Mapper Plugin Issues

**URL:** <https://discuss.elastic.co/t/mapper-plugin-issues/18270>\
**Category:** Elasticsearch\
**Created:** [June 23, 2014, 8:34pm UTC](https://discuss.elastic.co/t/mapper-plugin-issues/18270 "2014-06-23T20:34:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deepikaa\_Subramaniam](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@Deepikaa\_Subramaniam](https://discuss.elastic.co/u/Deepikaa_Subramaniam)\
**Post date:** [June 23, 2014, 8:34pm UTC](https://discuss.elastic.co/t/mapper-plugin-issues/18270/1 "2014-06-23T20:34:02Z")

</div>

I am using ElasticSearch mapper plugin for indexing contents for pdf, xls,  
ppt file types. My mapping is as follows:

```
[ElasticType(
    Name = "IndexDocument",
    SearchAnalyzer = "standard",
    IndexAnalyzer = "standard",
    DateDetection = true,
    NumericDetection = true
)]
public class Document
{
    public string id { get; set; }
    [ElasticProperty(Type = Nest.FieldType.attachment, Store = false, TermVector = Nest.TermVectorOption.with_positions_offsets)]
    public ESAttachment esAttachment { get; set; }
}

public class ESAttachment
{
    public string _content_type { get; set; }
    public string _name { get; set; }
    public string content { get; set; }
}

```

Here is the code for indexing:

```
    esClient.MapFromAttributes<Document>();

    var item = new Document();
    item.esAttachment = new ESAttachment();
    item.esAttachment._content_type = "application/pdf";
    item.esAttachment.content = Convert.ToBase64String(System.IO.File.ReadAllBytes(file));
    item.esAttachment._name = "test-pdf";

    List<Document> bulkDoc = new List<Document>();
    bulkDoc.Add(item);

    var des = new BulkDescriptor();
    foreach (var doc in bulkDoc)
    {
        des.Index<Document>(j => j.Object(doc).Index("indexname"));
    }

    var status = esClient.BulkAsync(des);

```

--  
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/45e6937d-9553-40ed-bc23-02a84d7f3d3c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/45e6937d-9553-40ed-bc23-02a84d7f3d3c%40googlegroups.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, 1:20am UTC](https://discuss.elastic.co/t/mapper-plugin-issues/18270/2 "2017-07-06T01:20:27Z")

</div>


