# How to put custom analyzer mapping on rabbitmq river?

**URL:** https://discuss.elastic.co/t/how-to-put-custom-analyzer-mapping-on-rabbitmq-river/6427
**Category:** Elasticsearch
**Created:** [January 18, 2012, 9:28am UTC](https://discuss.elastic.co/t/how-to-put-custom-analyzer-mapping-on-rabbitmq-river/6427 "2012-01-18T09:28:18Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![shammi\_mishra](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@shammi\_mishra](https://discuss.elastic.co/u/shammi_mishra)
#### Post date: [January 18, 2012, 9:28am UTC](https://discuss.elastic.co/t/how-to-put-custom-analyzer-mapping-on-rabbitmq-river/6427/1 "2012-01-18T09:28:18Z")

</div>

Hi

Is there is any way to override the default analyzer when creating  
rabbitmq river, because rabbitmq river uses the bulk message format.  
if it possible to please provide the mapping details.

also I have read following document,but i did not get how to send  
mapping with bulk message format.

Index / Search Analyzers  
[http://www.elasticsearch.org/guide/reference/mapping/root-object-type](http://www.elasticsearch.org/guide/reference/mapping/root-object-type)...  
Analyzer  
[http://www.elasticsearch.org/guide/reference/index-modules/analysis/](http://www.elasticsearch.org/guide/reference/index-modules/analysis/)  
Core Types  
[http://www.elasticsearch.org/guide/reference/mapping/core-types.html](http://www.elasticsearch.org/guide/reference/mapping/core-types.html)

please help me?

---

<div class="post-metadata">

### Author: ![Sam\_4](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@Sam\_4](https://discuss.elastic.co/u/Sam_4)
#### Post date: [January 18, 2012, 12:10pm UTC](https://discuss.elastic.co/t/how-to-put-custom-analyzer-mapping-on-rabbitmq-river/6427/2 "2012-01-18T12:10:29Z")

</div>

You need to predefine the mapping using the put mapping API, and then  
start indexing using river

//prepare mapping

```
            XContentBuilder indexSettings = null;
            XContentBuilder stopwordfilter = null;

            stopwordfilter = XContentFactory.jsonBuilder();

```

stopwordfilter.startObject().startObject("stopwordfilter").field("type",  
"stop").field("stopwords\_path", "c:\resources  
\stopwords\_eng.txt").field("ignore\_case", "true").endObject();  
System.out.println(stopwordfilter.string());

```
            indexSettings = XContentFactory.jsonBuilder();

```

indexSettings.startObject().startObject("index").startObject("analysis").startObject("analyzer").startObject("index\_analyzer").field("type",  
"custom").field("tokenizer", "whitespace").field("filter", new String  
{"stopwordfilter"}) //.field("char\_filter", new String  
{"html\_strip"})  
.field("filter",  
stopwordfilter).endObject().endObject().endObject().endObject().endObject();  
System.out.println(indexSettings.string());

```
         // putting mapping API

            String[] indices1= new String[1];
            indices1[0]=indexName;
            PutMappingRequest putMappingRequest = new

```

PutMappingRequest(indexName);  
PutMappingRequest source =  
putMappingRequest.source(indexSettings).indices(indices1).type(indexType).ignoreConflicts(true);  
PutMappingResponse actionGet1 =  
client.admin().indices().putMapping(source).actionGet();  
boolean acknowledged = actionGet1.getAcknowledged();  
System.out.println(acknowledged);

On Jan 18, 2:28 pm, shammi mishra [mishrashamm...@gmail.com](mailto:mishrashamm...@gmail.com) wrote:

> Hi
> 
> Is there is any way to override the default analyzer when creating  
> rabbitmq river, because rabbitmq river uses the bulk message format.  
> if it possible to please provide the mapping details.
> 
> also I have read following document,but i did not get how to send  
> mapping with bulk message format.
> 
> Index / Search Analyzershttp://www.elasticsearch.org/guide/reference/mapping/root-object-type...  
> Analyzerhttp://www.elasticsearch.org/guide/reference/index-modules/analysis/  
> Core Typeshttp://www.elasticsearch.org/guide/reference/mapping/core-types.html
> 
> please help me?

---

<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, 3:42am UTC](https://discuss.elastic.co/t/how-to-put-custom-analyzer-mapping-on-rabbitmq-river/6427/3 "2017-07-06T03:42:22Z")

</div>


