# Unable to configure custom analyzer with rabbitmq river?

**URL:** https://discuss.elastic.co/t/unable-to-configure-custom-analyzer-with-rabbitmq-river/6422
**Category:** Elasticsearch
**Created:** [January 18, 2012, 5:42am UTC](https://discuss.elastic.co/t/unable-to-configure-custom-analyzer-with-rabbitmq-river/6422 "2012-01-18T05:42:24Z")
**Posts on this page:** 6
**Page:** 1

<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, 5:42am UTC](https://discuss.elastic.co/t/unable-to-configure-custom-analyzer-with-rabbitmq-river/6422/1 "2012-01-18T05:42:24Z")

</div>

Hi

I am working with elastic search and using RabbitMQ River. I want to  
use custom analyzer. When I read about it I found few ways to  
configure it but when I executed with the mapping it did not gave me  
any parsing exception but also not got the predicted output while  
searching.

Tested Output:

I included "inc" in the stop words file but when I searched "inc" it  
should give me 0 hits as the stop word filter, filters the stop words  
from the index but I am getting 1 hit as the text I have indexed  
contain "inc".

This made me sure that the custom analyzer is not configured  
correctly.

I refer [https://groups.google.com/group/elasticsearch/browse\_thread/thread/bd1a6a94a8c94e20](https://groups.google.com/group/elasticsearch/browse_thread/thread/bd1a6a94a8c94e20)  
but got no success when executed this mapping.  
I used this mapping [https://gist.github.com/1626452](https://gist.github.com/1626452) but I am not sure  
that this is completely correct.Please tell me where I am going wrong  
and what changes are needed to be made.

Thanks

---

<div class="post-metadata">

### Author: ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)
#### Post date: [January 18, 2012, 9:04pm UTC](https://discuss.elastic.co/t/unable-to-configure-custom-analyzer-with-rabbitmq-river/6422/2 "2012-01-18T21:04:12Z")

</div>

Before you create the river, you need to precreate the index it will index  
into, and have the relevant mappings set on it (and settings, like analysis  
settings).

On Wed, Jan 18, 2012 at 7:42 AM, sam [mishra.sameek@gmail.com](mailto:mishra.sameek@gmail.com) wrote:

> Hi
> 
> I am working with Elasticsearch and using RabbitMQ River. I want to  
> use custom analyzer. When I read about it I found few ways to  
> configure it but when I executed with the mapping it did not gave me  
> any parsing exception but also not got the predicted output while  
> searching.
> 
> Tested Output:
> 
> I included "inc" in the stop words file but when I searched "inc" it  
> should give me 0 hits as the stop word filter, filters the stop words  
> from the index but I am getting 1 hit as the text I have indexed  
> contain "inc".
> 
> This made me sure that the custom analyzer is not configured  
> correctly.
> 
> I refer  
> [https://groups.google.com/group/elasticsearch/browse\_thread/thread/bd1a6a94a8c94e20](https://groups.google.com/group/elasticsearch/browse_thread/thread/bd1a6a94a8c94e20)  
> but got no success when executed this mapping.  
> I used this mapping [River Mapping · GitHub](https://gist.github.com/1626452) but I am not sure  
> that this is completely correct.Please tell me where I am going wrong  
> and what changes are needed to be made.
> 
> Thanks

---

<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 19, 2012, 7:35am UTC](https://discuss.elastic.co/t/unable-to-configure-custom-analyzer-with-rabbitmq-river/6422/3 "2012-01-19T07:35:58Z")

</div>

Thanks for reply shay.

As you said I created index with the defined mapping in it and river it.  
The implemented class can be viewed at [RabbitMQ River With Custom Analyzer · GitHub](https://gist.github.com/1638251)  
.I have mentioned code snippet on gist SearchTest.java  
#[https://gist.github.com/1638251#file\_search\_test.java](https://gist.github.com/1638251#file_search_test.java) where  
I am trying to search data "inc" with using logical name search\_analyzer  
but again the result is not expected as I included "inc" in Stop Word List  
, again I am not sure the mapping I have set is being utilized or not.

I am stuck with the following points:

- Can you please tell me the way, to verify the mapping details that are  
currently being used on index using java.
- If I am following wrong way while searching the data how can I correct  
it to make it work using java API.

Thanks

On Thu, Jan 19, 2012 at 2:34 AM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> Before you create the river, you need to precreate the index it will index  
> into, and have the relevant mappings set on it (and settings, like analysis  
> settings).
> 
> On Wed, Jan 18, 2012 at 7:42 AM, sam [mishra.sameek@gmail.com](mailto:mishra.sameek@gmail.com) wrote:
> 
> > Hi
> > 
> > I am working with Elasticsearch and using RabbitMQ River. I want to  
> > use custom analyzer. When I read about it I found few ways to  
> > configure it but when I executed with the mapping it did not gave me  
> > any parsing exception but also not got the predicted output while  
> > searching.
> > 
> > Tested Output:
> > 
> > I included "inc" in the stop words file but when I searched "inc" it  
> > should give me 0 hits as the stop word filter, filters the stop words  
> > from the index but I am getting 1 hit as the text I have indexed  
> > contain "inc".
> > 
> > This made me sure that the custom analyzer is not configured  
> > correctly.
> > 
> > I refer  
> > [https://groups.google.com/group/elasticsearch/browse\_thread/thread/bd1a6a94a8c94e20](https://groups.google.com/group/elasticsearch/browse_thread/thread/bd1a6a94a8c94e20)  
> > but got no success when executed this mapping.  
> > I used this mapping [River Mapping · GitHub](https://gist.github.com/1626452) but I am not sure  
> > that this is completely correct.Please tell me where I am going wrong  
> > and what changes are needed to be made.
> > 
> > Thanks

---

<div class="post-metadata">

### Author: ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)
#### Post date: [January 19, 2012, 6:41pm UTC](https://discuss.elastic.co/t/unable-to-configure-custom-analyzer-with-rabbitmq-river/6422/4 "2012-01-19T18:41:17Z")

</div>

You are putting the analyzer config as a mapping. The analyzer config is  
placed in the settings of an index (or in the config file), and mapping  
define the how the json document ends up being indexed, for example, have a  
specific field associated with a custom analyzer defined in your settings.

On Thu, Jan 19, 2012 at 9:35 AM, sameek mishra [mishra.sameek@gmail.com](mailto:mishra.sameek@gmail.com)wrote:

> Thanks for reply shay.
> 
> As you said I created index with the defined mapping in it and river it.  
> The implemented class can be viewed at [RabbitMQ River With Custom Analyzer · GitHub](https://gist.github.com/1638251)  
> .I have mentioned code snippet on gist SearchTest.java #[https://gist.github.com/1638251#file\_search\_test.java](https://gist.github.com/1638251#file_search_test.java) where  
> I am trying to search data "inc" with using logical name search\_analyzer  
> but again the result is not expected as I included "inc" in Stop Word List  
> , again I am not sure the mapping I have set is being utilized or not.
> 
> I am stuck with the following points:
> 
> - Can you please tell me the way, to verify the mapping details that  
> are currently being used on index using java.
> - If I am following wrong way while searching the data how can I  
> correct it to make it work using java API.
> 
> Thanks
> 
> On Thu, Jan 19, 2012 at 2:34 AM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> 
> > Before you create the river, you need to precreate the index it will  
> > index into, and have the relevant mappings set on it (and settings, like  
> > analysis settings).
> > 
> > On Wed, Jan 18, 2012 at 7:42 AM, sam [mishra.sameek@gmail.com](mailto:mishra.sameek@gmail.com) wrote:
> > 
> > > Hi
> > > 
> > > I am working with Elasticsearch and using RabbitMQ River. I want to  
> > > use custom analyzer. When I read about it I found few ways to  
> > > configure it but when I executed with the mapping it did not gave me  
> > > any parsing exception but also not got the predicted output while  
> > > searching.
> > > 
> > > Tested Output:
> > > 
> > > I included "inc" in the stop words file but when I searched "inc" it  
> > > should give me 0 hits as the stop word filter, filters the stop words  
> > > from the index but I am getting 1 hit as the text I have indexed  
> > > contain "inc".
> > > 
> > > This made me sure that the custom analyzer is not configured  
> > > correctly.
> > > 
> > > I refer  
> > > [https://groups.google.com/group/elasticsearch/browse\_thread/thread/bd1a6a94a8c94e20](https://groups.google.com/group/elasticsearch/browse_thread/thread/bd1a6a94a8c94e20)  
> > > but got no success when executed this mapping.  
> > > I used this mapping [River Mapping · GitHub](https://gist.github.com/1626452) but I am not sure  
> > > that this is completely correct.Please tell me where I am going wrong  
> > > and what changes are needed to be made.
> > > 
> > > Thanks

---

<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 20, 2012, 7:53am UTC](https://discuss.elastic.co/t/unable-to-configure-custom-analyzer-with-rabbitmq-river/6422/5 "2012-01-20T07:53:18Z")

</div>

Thanks for your reply and support.the above solution you gave worked  
perfectly for me.I have updated the gist that executed perfectly.

> <https://gist.github.com/sameek/1638251>
>
> There are more than three files. show original

On Jan 19, 11:41 pm, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:

> You are putting the analyzer config as a mapping. The analyzer config is  
> placed in the settings of an index (or in the config file), and mapping  
> define the how the json document ends up being indexed, for example, have a  
> specific field associated with a custom analyzer defined in your settings.
> 
> On Thu, Jan 19, 2012 at 9:35 AM, sameek mishra [mishra.sam...@gmail.com](mailto:mishra.sam...@gmail.com)wrote:
> 
> > Thanks for reply shay.
> 
> > As you said I created index with the defined mapping in it and river it.  
> > The implemented class can be viewed athttps://gist.github.com/1638251  
> > .I have mentioned code snippet on gist SearchTest.java #[https://gist.github.com/1638251#file\_search\_test.java](https://gist.github.com/1638251#file_search_test.java) where  
> > I am trying to search data "inc" with using logical name search\_analyzer  
> > but again the result is not expected as I included "inc" in Stop Word List  
> > , again I am not sure the mapping I have set is being utilized or not.
> 
> > I am stuck with the following points:
> 
> > - Can you please tell me the way, to verify the mapping details that  
> > are currently being used on index using java.
> > - If I am following wrong way while searching the data how can I  
> > correct it to make it work using java API.
> 
> > Thanks
> 
> > On Thu, Jan 19, 2012 at 2:34 AM, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> 
> > > Before you create the river, you need to precreate the index it will  
> > > index into, and have the relevant mappings set on it (and settings, like  
> > > analysis settings).
> 
> > > On Wed, Jan 18, 2012 at 7:42 AM, sam [mishra.sam...@gmail.com](mailto:mishra.sam...@gmail.com) wrote:
> 
> > > > Hi
> 
> > > > I am working with Elasticsearch and using RabbitMQ River. I want to  
> > > > use custom analyzer. When I read about it I found few ways to  
> > > > configure it but when I executed with the mapping it did not gave me  
> > > > any parsing exception but also not got the predicted output while  
> > > > searching.
> 
> > > > Tested Output:
> 
> > > > I included "inc" in the stop words file but when I searched "inc" it  
> > > > should give me 0 hits as the stop word filter, filters the stop words  
> > > > from the index but I am getting 1 hit as the text I have indexed  
> > > > contain "inc".
> 
> > > > This made me sure that the custom analyzer is not configured  
> > > > correctly.
> 
> > > > I refer  
> > > > [https://groups.google.com/group/elasticsearch/browse\_thread/thread/bd](https://groups.google.com/group/elasticsearch/browse_thread/thread/bd)...  
> > > > but got no success when executed this mapping.  
> > > > I used this mappinghttps://gist.github.com/1626452but I am not sure  
> > > > that this is completely correct.Please tell me where I am going wrong  
> > > > and what changes are needed to be made.
> 
> > > > Thanks

---

<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/unable-to-configure-custom-analyzer-with-rabbitmq-river/6422/6 "2017-07-06T03:42:01Z")

</div>


