# Problem with attachment mapping

**URL:** <https://discuss.elastic.co/t/problem-with-attachment-mapping/3393>\
**Category:** Elasticsearch\
**Created:** [October 1, 2010, 12:30pm UTC](https://discuss.elastic.co/t/problem-with-attachment-mapping/3393 "2010-10-01T12:30:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ruflin\_2](https://avatars.discourse-cdn.com/v4/letter/r/a8b319/32.png) [@ruflin\_2](https://discuss.elastic.co/u/ruflin_2)\
**Post date:** [October 1, 2010, 12:30pm UTC](https://discuss.elastic.co/t/problem-with-attachment-mapping/3393/1 "2010-10-01T12:30:21Z")

</div>

Hi

I'm trying to use the attachment plugin with the data type. It seems  
like installing the problem worked as expected. During starting  
elasticsearch shows the following line:

[2010-10-01 14:20:12,577][INFO][plugins] [Rebel]  
loaded [analysis-icu]

Now I wanted to add an attachment field to my mapping. But as soon the  
attachment type is inside, not mapping is set:

I'm using my own php client that communicates with the REST API. The  
following code works:

```
    $indexMapping = array(
    	'file' => array('type' => 'string'),
		'text' => array('type' => 'string', 'store' => 'no'),
    );

```

As soon as I change the type to attachment, the mapping is no set. Any  
ideas?

```
    $indexMapping = array(
    	'file' => array('type' => 'attachment'),
		'text' => array('type' => 'string', 'store' => 'no'),
    );

```

I followed in general this documentation:  
[http://www.elasticsearch.com/docs/elasticsearch/mapping/attachment/](http://www.elasticsearch.com/docs/elasticsearch/mapping/attachment/)

---

<div class="post-metadata">

**Author:** ![Lukas\_Vlcek1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas_vlcek1/32/819_2.png) [@Lukas\_Vlcek1](https://discuss.elastic.co/u/Lukas_Vlcek1)\
**Post date:** [October 1, 2010, 3:25pm UTC](https://discuss.elastic.co/t/problem-with-attachment-mapping/3393/2 "2010-10-01T15:25:33Z")

</div>

Hi,

If I read your excerpt from log correctly then in fact you did not install  
attachment plugin but analysis plugin (  
[http://www.elasticsearch.com/docs/elasticsearch/index\_modules/analysis/icu/](http://www.elasticsearch.com/docs/elasticsearch/index_modules/analysis/icu/)  
).  
If attachment plugin is installed then you will see the following in log  
file:  
loaded [mapper-attachments]

The plugin jars can be found here:  
[http://oss.sonatype.org/content/repositories/releases/org/elasticsearch/elasticsearch-mapper-attachments/](http://oss.sonatype.org/content/repositories/releases/org/elasticsearch/elasticsearch-mapper-attachments/)

Regards,  
Lukas

On Fri, Oct 1, 2010 at 2:30 PM, ruflin [ruflin@gmail.com](mailto:ruflin@gmail.com) wrote:

> Hi
> 
> I'm trying to use the attachment plugin with the data type. It seems  
> like installing the problem worked as expected. During starting  
> elasticsearch shows the following line:
> 
> [2010-10-01 14:20:12,577][INFO][plugins] [Rebel]  
> loaded [analysis-icu]
> 
> Now I wanted to add an attachment field to my mapping. But as soon the  
> attachment type is inside, not mapping is set:
> 
> I'm using my own php client that communicates with the REST API. The  
> following code works:
> 
> ```
> $indexMapping = array(
> 'file' => array('type' => 'string'),
> 'text' => array('type' => 'string', 'store' => 'no'),
> );
> 
> ```
> 
> As soon as I change the type to attachment, the mapping is no set. Any  
> ideas?
> 
> ```
> $indexMapping = array(
> 'file' => array('type' => 'attachment'),
> 'text' => array('type' => 'string', 'store' => 'no'),
> );
> 
> ```
> 
> I followed in general this documentation:  
> [http://www.elasticsearch.com/docs/elasticsearch/mapping/attachment/](http://www.elasticsearch.com/docs/elasticsearch/mapping/attachment/)

---

<div class="post-metadata">

**Author:** ![ruflin\_2](https://avatars.discourse-cdn.com/v4/letter/r/a8b319/32.png) [@ruflin\_2](https://discuss.elastic.co/u/ruflin_2)\
**Post date:** [October 1, 2010, 8:57pm UTC](https://discuss.elastic.co/t/problem-with-attachment-mapping/3393/3 "2010-10-01T20:57:32Z")

</div>

Hi Lukas

Thanks for your help. Seems like I really piked the wrong one.

I wasn't sure how to install a jar file, but finally I found this  
page, where all plugins are listed:  
[http://elasticsearch.googlecode.com/svn/plugins/](http://elasticsearch.googlecode.com/svn/plugins/)

Like this I can run  
./bin/plugin install mapper-attachments

Nicolas

On Oct 1, 5:25 pm, Lukáš Vlček [lukas.vl...@gmail.com](mailto:lukas.vl...@gmail.com) wrote:

> Hi,
> 
> If I read your excerpt from log correctly then in fact you did not install  
> attachment plugin but analysis plugin ([http://www.elasticsearch.com/docs/elasticsearch/index\_modules/analysi](http://www.elasticsearch.com/docs/elasticsearch/index_modules/analysi)...  
> ).  
> If attachment plugin is installed then you will see the following in log  
> file:  
> loaded [mapper-attachments]
> 
> The plugin jars can be found here:[http://oss.sonatype.org/content/repositories/releases/org/elasticsear](http://oss.sonatype.org/content/repositories/releases/org/elasticsear)...
> 
> Regards,  
> Lukas
> 
> On Fri, Oct 1, 2010 at 2:30 PM, ruflin [ruf...@gmail.com](mailto:ruf...@gmail.com) wrote:
> 
> > Hi
> 
> > I'm trying to use the attachment plugin with the data type. It seems  
> > like installing the problem worked as expected. During starting  
> > elasticsearch shows the following line:
> 
> > [2010-10-01 14:20:12,577][INFO][plugins] [Rebel]  
> > loaded [analysis-icu]
> 
> > Now I wanted to add an attachment field to my mapping. But as soon the  
> > attachment type is inside, not mapping is set:
> 
> > I'm using my own php client that communicates with the REST API. The  
> > following code works:
> 
> > ```
> > $indexMapping = array(
> > 'file' => array('type' => 'string'),
> > 'text' => array('type' => 'string', 'store' => 'no'),
> > );
> > 
> > ```
> 
> > As soon as I change the type to attachment, the mapping is no set. Any  
> > ideas?
> 
> > ```
> > $indexMapping = array(
> > 'file' => array('type' => 'attachment'),
> > 'text' => array('type' => 'string', 'store' => 'no'),
> > );
> > 
> > ```
> 
> > I followed in general this documentation:  
> > [http://www.elasticsearch.com/docs/elasticsearch/mapping/attachment/](http://www.elasticsearch.com/docs/elasticsearch/mapping/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:** [July 6, 2017, 4:18am UTC](https://discuss.elastic.co/t/problem-with-attachment-mapping/3393/4 "2017-07-06T04:18:34Z")

</div>


