# Custom similarity setting does not work with version 0.20.2

**URL:** <https://discuss.elastic.co/t/custom-similarity-setting-does-not-work-with-version-0-20-2/10662>\
**Category:** Elasticsearch\
**Created:** [February 8, 2013, 6:47am UTC](https://discuss.elastic.co/t/custom-similarity-setting-does-not-work-with-version-0-20-2/10662 "2013-02-08T06:47:49Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mustafa\_Sener](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@Mustafa\_Sener](https://discuss.elastic.co/u/Mustafa_Sener)\
**Post date:** [February 8, 2013, 6:47am UTC](https://discuss.elastic.co/t/custom-similarity-setting-does-not-work-with-version-0-20-2/10662/1 "2013-02-08T06:47:49Z")

</div>

Hi,  
I tried following configurations for my custom similarity provider but none  
of them worked with version 0.20. Can anyone give me some information about  
this setting for version 0.20.2? Any sample usages will be enough for me

curl -XPOST '[http://host](http://host):port/tweeter/' -d '  
{  
"settings": {  
"similarity": {  
"index": {  
"type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"  
},  
"search": {  
"type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"  
}  
}  
}  
}

index.similarity.index.type  
index.similarity.search.type

None of these works.

Thanks...

--  
Mustafa Sener

--  
Mustafa Sener  
[www.ifountain.com](http://www.ifountain.com)

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![benjamin\_leviant](https://avatars.discourse-cdn.com/v4/letter/b/919ad9/32.png) [@benjamin\_leviant](https://discuss.elastic.co/u/benjamin_leviant)\
**Post date:** [February 8, 2013, 8:33am UTC](https://discuss.elastic.co/t/custom-similarity-setting-does-not-work-with-version-0-20-2/10662/2 "2013-02-08T08:33:34Z")

</div>

Hello,

you should try this command :

curl -XPOST '[http://host](http://host):port/tweeter/' -d '  
{  
"settings": {  
"index": {  
"similarity": {  
"index": {  
"type":  
"org.elasticsearch.index.similarity.CustomSimilarityProvider"  
},  
"search": {  
"type":  
"org.elasticsearch.index.similarity.CustomSimilarityProvider"  
}  
}  
}  
}  
}

I hope it can help you.

Regards

Benjamin

On Fri, Feb 8, 2013 at 7:47 AM, Mustafa Sener [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)wrote:

> Hi,  
> I tried following configurations for my custom similarity provider but  
> none of them worked with version 0.20. Can anyone give me some information  
> about this setting for version 0.20.2? Any sample usages will be enough for  
> me
> 
> curl -XPOST '[http://host](http://host):port/tweeter/' -d '  
> {  
> "settings": {  
> "similarity": {  
> "index": {  
> "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"  
> },  
> "search": {  
> "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"  
> }  
> }  
> }  
> }
> 
> index.similarity.index.type  
> index.similarity.search.type
> 
> None of these works.
> 
> Thanks...
> 
> --  
> Mustafa Sener
> 
> --  
> Mustafa Sener  
> [www.ifountain.com](http://www.ifountain.com)
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Mustafa\_Sener](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@Mustafa\_Sener](https://discuss.elastic.co/u/Mustafa_Sener)\
**Post date:** [February 8, 2013, 8:40am UTC](https://discuss.elastic.co/t/custom-similarity-setting-does-not-work-with-version-0-20-2/10662/3 "2013-02-08T08:40:45Z")

</div>

That does not work too. I tried it before.

On Fri, Feb 8, 2013 at 10:33 AM, benjamin leviant \<  
[benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:

> Hello,
> 
> you should try this command :
> 
> curl -XPOST '[http://host](http://host):port  
> /tweeter/' -d '  
> {  
> "settings": {  
> "index": {
> 
> ```
> "similarity": {
> "index": {
> "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"
> },
> "search": {
> "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"
> }
> }
> }
> }
> 
> ```
> 
> }
> 
> I hope it can help you.
> 
> Regards
> 
> Benjamin
> 
> On Fri, Feb 8, 2013 at 7:47 AM, Mustafa Sener [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)wrote:
> 
> > Hi,  
> > I tried following configurations for my custom similarity provider but  
> > none of them worked with version 0.20. Can anyone give me some information  
> > about this setting for version 0.20.2? Any sample usages will be enough for  
> > me
> > 
> > curl -XPOST '[http://host](http://host):port/tweeter/' -d '  
> > {  
> > "settings": {  
> > "similarity": {  
> > "index": {  
> > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"  
> > },  
> > "search": {  
> > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"  
> > }  
> > }  
> > }  
> > }
> > 
> > index.similarity.index.type  
> > index.similarity.search.type
> > 
> > None of these works.
> > 
> > Thanks...
> > 
> > --  
> > Mustafa Sener
> > 
> > --  
> > Mustafa Sener  
> > [www.ifountain.com](http://www.ifountain.com)
> > 
> > --  
> > 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).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
Mustafa Sener [http://www.ifountain.com](http://www.ifountain.com)

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![benjamin\_leviant](https://avatars.discourse-cdn.com/v4/letter/b/919ad9/32.png) [@benjamin\_leviant](https://discuss.elastic.co/u/benjamin_leviant)\
**Post date:** [February 8, 2013, 9:42am UTC](https://discuss.elastic.co/t/custom-similarity-setting-does-not-work-with-version-0-20-2/10662/4 "2013-02-08T09:42:56Z")

</div>

Hi,

What is your the error message ?

How do you get your custom class loaded ?

Regards

Benjamin

On Fri, Feb 8, 2013 at 9:40 AM, Mustafa Sener [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)wrote:

> That does not work too. I tried it before.
> 
> On Fri, Feb 8, 2013 at 10:33 AM, benjamin leviant \<  
> [benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:
> 
> > Hello,
> > 
> > you should try this command :
> > 
> > curl -XPOST '[http://host](http://host):port  
> > /tweeter/' -d '  
> > {  
> > "settings": {  
> > "index": {
> > 
> > ```
> > "similarity": {
> > "index": {
> > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"
> > },
> > "search": {
> > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"
> > }
> > }
> > }
> > }
> > 
> > ```
> > 
> > }
> > 
> > I hope it can help you.
> > 
> > Regards
> > 
> > Benjamin
> > 
> > On Fri, Feb 8, 2013 at 7:47 AM, Mustafa Sener [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)wrote:
> > 
> > > Hi,  
> > > I tried following configurations for my custom similarity provider but  
> > > none of them worked with version 0.20. Can anyone give me some information  
> > > about this setting for version 0.20.2? Any sample usages will be enough for  
> > > me
> > > 
> > > curl -XPOST '[http://host](http://host):port/tweeter/' -d '  
> > > {  
> > > "settings": {  
> > > "similarity": {  
> > > "index": {  
> > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"  
> > > },  
> > > "search": {  
> > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"  
> > > }  
> > > }  
> > > }  
> > > }
> > > 
> > > index.similarity.index.type  
> > > index.similarity.search.type
> > > 
> > > None of these works.
> > > 
> > > Thanks...
> > > 
> > > --  
> > > Mustafa Sener
> > > 
> > > --  
> > > Mustafa Sener  
> > > [www.ifountain.com](http://www.ifountain.com)
> > > 
> > > --  
> > > 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).  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > --  
> > 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).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> Mustafa Sener  
> [http://www.ifountain.com](http://www.ifountain.com)
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Mustafa\_Sener](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@Mustafa\_Sener](https://discuss.elastic.co/u/Mustafa_Sener)\
**Post date:** [February 8, 2013, 10:00am UTC](https://discuss.elastic.co/t/custom-similarity-setting-does-not-work-with-version-0-20-2/10662/5 "2013-02-08T10:00:31Z")

</div>

I have no error messages. It seems that this setting is different before  
version 0.20. Since there is no documentation about this, I cannot  
configure it properly.

On Fri, Feb 8, 2013 at 11:42 AM, benjamin leviant \<  
[benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:

> Hi,
> 
> What is your the error message ?
> 
> How do you get your custom class loaded ?
> 
> Regards
> 
> Benjamin
> 
> On Fri, Feb 8, 2013 at 9:40 AM, Mustafa Sener [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)wrote:
> 
> > That does not work too. I tried it before.
> > 
> > On Fri, Feb 8, 2013 at 10:33 AM, benjamin leviant \<  
> > [benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:
> > 
> > > Hello,
> > > 
> > > you should try this command :
> > > 
> > > curl -XPOST '[http://host](http://host):port  
> > > /tweeter/' -d '  
> > > {  
> > > "settings": {  
> > > "index": {
> > > 
> > > ```
> > > "similarity": {
> > > "index": {
> > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"
> > > },
> > > "search": {
> > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"
> > > }
> > > }
> > > }
> > > }
> > > 
> > > ```
> > > 
> > > }
> > > 
> > > I hope it can help you.
> > > 
> > > Regards
> > > 
> > > Benjamin
> > > 
> > > On Fri, Feb 8, 2013 at 7:47 AM, Mustafa Sener [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)wrote:
> > > 
> > > > Hi,  
> > > > I tried following configurations for my custom similarity provider but  
> > > > none of them worked with version 0.20. Can anyone give me some information  
> > > > about this setting for version 0.20.2? Any sample usages will be enough for  
> > > > me
> > > > 
> > > > curl -XPOST '[http://host](http://host):port/tweeter/' -d '  
> > > > {  
> > > > "settings": {  
> > > > "similarity": {  
> > > > "index": {  
> > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"  
> > > > },  
> > > > "search": {  
> > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"  
> > > > }  
> > > > }  
> > > > }  
> > > > }
> > > > 
> > > > index.similarity.index.type  
> > > > index.similarity.search.type
> > > > 
> > > > None of these works.
> > > > 
> > > > Thanks...
> > > > 
> > > > --  
> > > > Mustafa Sener
> > > > 
> > > > --  
> > > > Mustafa Sener  
> > > > [www.ifountain.com](http://www.ifountain.com)
> > > > 
> > > > --  
> > > > 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).  
> > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > 
> > > --  
> > > 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).  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > --  
> > Mustafa Sener  
> > [http://www.ifountain.com](http://www.ifountain.com)
> > 
> > --  
> > 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).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
Mustafa Sener [http://www.ifountain.com](http://www.ifountain.com)

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![benjamin\_leviant](https://avatars.discourse-cdn.com/v4/letter/b/919ad9/32.png) [@benjamin\_leviant](https://discuss.elastic.co/u/benjamin_leviant)\
**Post date:** [February 8, 2013, 10:27am UTC](https://discuss.elastic.co/t/custom-similarity-setting-does-not-work-with-version-0-20-2/10662/6 "2013-02-08T10:27:52Z")

</div>

I use a custom similarity on Elasticsearch 0.20.1 and it work perfectly  
well.

If you dont have any error message when you create your index, then your  
custom similarity should be enable for search and index operations on this  
index.

May be your problem is caused by the way your similarity provider is  
implemented. Can you post the code ?

Regards

Benjamin

On Fri, Feb 8, 2013 at 11:00 AM, Mustafa Sener [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)wrote:

> I have no error messages. It seems that this setting is different before  
> version 0.20. Since there is no documentation about this, I cannot  
> configure it properly.
> 
> On Fri, Feb 8, 2013 at 11:42 AM, benjamin leviant \<  
> [benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:
> 
> > Hi,
> > 
> > What is your the error message ?
> > 
> > How do you get your custom class loaded ?
> > 
> > Regards
> > 
> > Benjamin
> > 
> > On Fri, Feb 8, 2013 at 9:40 AM, Mustafa Sener [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)wrote:
> > 
> > > That does not work too. I tried it before.
> > > 
> > > On Fri, Feb 8, 2013 at 10:33 AM, benjamin leviant \<  
> > > [benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:
> > > 
> > > > Hello,
> > > > 
> > > > you should try this command :
> > > > 
> > > > curl -XPOST '[http://host](http://host):port  
> > > > /tweeter/' -d '  
> > > > {  
> > > > "settings": {  
> > > > "index": {
> > > > 
> > > > ```
> > > > "similarity": {
> > > > "index": {
> > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"
> > > > },
> > > > "search": {
> > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"
> > > > }
> > > > }
> > > > }
> > > > }
> > > > 
> > > > ```
> > > > 
> > > > }
> > > > 
> > > > I hope it can help you.
> > > > 
> > > > Regards
> > > > 
> > > > Benjamin
> > > > 
> > > > On Fri, Feb 8, 2013 at 7:47 AM, Mustafa Sener [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)wrote:
> > > > 
> > > > > Hi,  
> > > > > I tried following configurations for my custom similarity provider but  
> > > > > none of them worked with version 0.20. Can anyone give me some information  
> > > > > about this setting for version 0.20.2? Any sample usages will be enough for  
> > > > > me
> > > > > 
> > > > > curl -XPOST '[http://host](http://host):port/tweeter/' -d '  
> > > > > {  
> > > > > "settings": {  
> > > > > "similarity": {  
> > > > > "index": {  
> > > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"  
> > > > > },  
> > > > > "search": {  
> > > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"  
> > > > > }  
> > > > > }  
> > > > > }  
> > > > > }
> > > > > 
> > > > > index.similarity.index.type  
> > > > > index.similarity.search.type
> > > > > 
> > > > > None of these works.
> > > > > 
> > > > > Thanks...
> > > > > 
> > > > > --  
> > > > > Mustafa Sener
> > > > > 
> > > > > --  
> > > > > Mustafa Sener  
> > > > > [www.ifountain.com](http://www.ifountain.com)
> > > > > 
> > > > > --  
> > > > > 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).  
> > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > 
> > > > --  
> > > > 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).  
> > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > 
> > > --  
> > > Mustafa Sener  
> > > [http://www.ifountain.com](http://www.ifountain.com)
> > > 
> > > --  
> > > 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).  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > --  
> > 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).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> Mustafa Sener [http://www.ifountain.com](http://www.ifountain.com)
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Mustafa\_Sener](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@Mustafa\_Sener](https://discuss.elastic.co/u/Mustafa_Sener)\
**Post date:** [February 8, 2013, 11:15am UTC](https://discuss.elastic.co/t/custom-similarity-setting-does-not-work-with-version-0-20-2/10662/7 "2013-02-08T11:15:14Z")

</div>

I use a FloatingPayload filter to create payloads for each term which is  
separated by '|' character (school|5.8). Then I use following similarity

> <https://gist.github.com/anonymous/4738207>

On Fri, Feb 8, 2013 at 12:27 PM, benjamin leviant \<  
[benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:

> I use a custom similarity on Elasticsearch 0.20.1 and it work perfectly  
> well.
> 
> If you dont have any error message when you create your index, then your  
> custom similarity should be enable for search and index operations on this  
> index.
> 
> May be your problem is caused by the way your similarity provider is  
> implemented. Can you post the code ?
> 
> Regards
> 
> Benjamin
> 
> On Fri, Feb 8, 2013 at 11:00 AM, Mustafa Sener [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)wrote:
> 
> > I have no error messages. It seems that this setting is different before  
> > version 0.20. Since there is no documentation about this, I cannot  
> > configure it properly.
> > 
> > On Fri, Feb 8, 2013 at 11:42 AM, benjamin leviant \<  
> > [benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:
> > 
> > > Hi,
> > > 
> > > What is your the error message ?
> > > 
> > > How do you get your custom class loaded ?
> > > 
> > > Regards
> > > 
> > > Benjamin
> > > 
> > > On Fri, Feb 8, 2013 at 9:40 AM, Mustafa Sener [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)wrote:
> > > 
> > > > That does not work too. I tried it before.
> > > > 
> > > > On Fri, Feb 8, 2013 at 10:33 AM, benjamin leviant \<  
> > > > [benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:
> > > > 
> > > > > Hello,
> > > > > 
> > > > > you should try this command :
> > > > > 
> > > > > curl -XPOST '[http://host](http://host):port  
> > > > > /tweeter/' -d '  
> > > > > {  
> > > > > "settings": {  
> > > > > "index": {
> > > > > 
> > > > > ```
> > > > > "similarity": {
> > > > > "index": {
> > > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"
> > > > > },
> > > > > "search": {
> > > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"
> > > > > }
> > > > > }
> > > > > }
> > > > > }
> > > > > 
> > > > > ```
> > > > > 
> > > > > }
> > > > > 
> > > > > I hope it can help you.
> > > > > 
> > > > > Regards
> > > > > 
> > > > > Benjamin
> > > > > 
> > > > > On Fri, Feb 8, 2013 at 7:47 AM, Mustafa Sener \<[mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)
> > > > > 
> > > > > > wrote:
> > > > > 
> > > > > > Hi,  
> > > > > > I tried following configurations for my custom similarity provider  
> > > > > > but none of them worked with version 0.20. Can anyone give me some  
> > > > > > information about this setting for version 0.20.2? Any sample usages will  
> > > > > > be enough for me
> > > > > > 
> > > > > > curl -XPOST '[http://host](http://host):port/tweeter/' -d '  
> > > > > > {  
> > > > > > "settings": {  
> > > > > > "similarity": {  
> > > > > > "index": {  
> > > > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"  
> > > > > > },  
> > > > > > "search": {  
> > > > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"  
> > > > > > }  
> > > > > > }  
> > > > > > }  
> > > > > > }
> > > > > > 
> > > > > > index.similarity.index.type  
> > > > > > index.similarity.search.type
> > > > > > 
> > > > > > None of these works.
> > > > > > 
> > > > > > Thanks...
> > > > > > 
> > > > > > --  
> > > > > > Mustafa Sener
> > > > > > 
> > > > > > --  
> > > > > > Mustafa Sener  
> > > > > > [www.ifountain.com](http://www.ifountain.com)
> > > > > > 
> > > > > > --  
> > > > > > 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).  
> > > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > > 
> > > > > --  
> > > > > 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).  
> > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > 
> > > > --  
> > > > Mustafa Sener  
> > > > [http://www.ifountain.com](http://www.ifountain.com)
> > > > 
> > > > --  
> > > > 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).  
> > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > 
> > > --  
> > > 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).  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > --  
> > Mustafa Sener [http://www.ifountain.com](http://www.ifountain.com)
> > 
> > --  
> > 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).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
Mustafa Sener

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![benjamin\_leviant](https://avatars.discourse-cdn.com/v4/letter/b/919ad9/32.png) [@benjamin\_leviant](https://discuss.elastic.co/u/benjamin_leviant)\
**Post date:** [February 8, 2013, 11:43am UTC](https://discuss.elastic.co/t/custom-similarity-setting-does-not-work-with-version-0-20-2/10662/8 "2013-02-08T11:43:16Z")

</div>

Your implementation looks good.

But to get payload working in elasticsearch, a custom similarity is not  
enough.

You need also to implement several custom elements :

- a token filter : to index payload values
- a query parser : to score using payload values

Do you have all these elements working ?

Regards

Benjamin

On Fri, Feb 8, 2013 at 12:15 PM, Mustafa Sener [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)wrote:

> I use a FloatingPayload filter to create payloads for each term which is  
> separated by '|' character (school|5.8). Then I use following similarity
> 
> [gist:4738207 · GitHub](https://gist.github.com/anonymous/4738207)
> 
> On Fri, Feb 8, 2013 at 12:27 PM, benjamin leviant \<  
> [benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:
> 
> > I use a custom similarity on Elasticsearch 0.20.1 and it work perfectly  
> > well.
> > 
> > If you dont have any error message when you create your index, then your  
> > custom similarity should be enable for search and index operations on this  
> > index.
> > 
> > May be your problem is caused by the way your similarity provider is  
> > implemented. Can you post the code ?
> > 
> > Regards
> > 
> > Benjamin
> > 
> > On Fri, Feb 8, 2013 at 11:00 AM, Mustafa Sener [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)wrote:
> > 
> > > I have no error messages. It seems that this setting is different before  
> > > version 0.20. Since there is no documentation about this, I cannot  
> > > configure it properly.
> > > 
> > > On Fri, Feb 8, 2013 at 11:42 AM, benjamin leviant \<  
> > > [benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:
> > > 
> > > > Hi,
> > > > 
> > > > What is your the error message ?
> > > > 
> > > > How do you get your custom class loaded ?
> > > > 
> > > > Regards
> > > > 
> > > > Benjamin
> > > > 
> > > > On Fri, Feb 8, 2013 at 9:40 AM, Mustafa Sener [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)wrote:
> > > > 
> > > > > That does not work too. I tried it before.
> > > > > 
> > > > > On Fri, Feb 8, 2013 at 10:33 AM, benjamin leviant \<  
> > > > > [benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:
> > > > > 
> > > > > > Hello,
> > > > > > 
> > > > > > you should try this command :
> > > > > > 
> > > > > > curl -XPOST '[http://host](http://host):port  
> > > > > > /tweeter/' -d '  
> > > > > > {  
> > > > > > "settings": {  
> > > > > > "index": {
> > > > > > 
> > > > > > ```
> > > > > > "similarity": {
> > > > > > "index": {
> > > > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"
> > > > > > },
> > > > > > "search": {
> > > > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"
> > > > > > }
> > > > > > }
> > > > > > }
> > > > > > }
> > > > > > 
> > > > > > ```
> > > > > > 
> > > > > > }
> > > > > > 
> > > > > > I hope it can help you.
> > > > > > 
> > > > > > Regards
> > > > > > 
> > > > > > Benjamin
> > > > > > 
> > > > > > On Fri, Feb 8, 2013 at 7:47 AM, Mustafa Sener \<  
> > > > > > [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)\> wrote:
> > > > > > 
> > > > > > > Hi,  
> > > > > > > I tried following configurations for my custom similarity provider  
> > > > > > > but none of them worked with version 0.20. Can anyone give me some  
> > > > > > > information about this setting for version 0.20.2? Any sample usages will  
> > > > > > > be enough for me
> > > > > > > 
> > > > > > > curl -XPOST '[http://host](http://host):port/tweeter/' -d '  
> > > > > > > {  
> > > > > > > "settings": {  
> > > > > > > "similarity": {  
> > > > > > > "index": {  
> > > > > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"  
> > > > > > > },  
> > > > > > > "search": {  
> > > > > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"  
> > > > > > > }  
> > > > > > > }  
> > > > > > > }  
> > > > > > > }
> > > > > > > 
> > > > > > > index.similarity.index.type  
> > > > > > > index.similarity.search.type
> > > > > > > 
> > > > > > > None of these works.
> > > > > > > 
> > > > > > > Thanks...
> > > > > > > 
> > > > > > > --  
> > > > > > > Mustafa Sener
> > > > > > > 
> > > > > > > --  
> > > > > > > Mustafa Sener  
> > > > > > > [www.ifountain.com](http://www.ifountain.com)
> > > > > > > 
> > > > > > > --  
> > > > > > > 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).  
> > > > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > > > 
> > > > > > --  
> > > > > > 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).  
> > > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > > 
> > > > > --  
> > > > > Mustafa Sener  
> > > > > [http://www.ifountain.com](http://www.ifountain.com)
> > > > > 
> > > > > --  
> > > > > 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).  
> > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > 
> > > > --  
> > > > 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).  
> > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > 
> > > --  
> > > Mustafa Sener [http://www.ifountain.com](http://www.ifountain.com)
> > > 
> > > --  
> > > 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).  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > --  
> > 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).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> Mustafa Sener
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Mustafa\_Sener](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@Mustafa\_Sener](https://discuss.elastic.co/u/Mustafa_Sener)\
**Post date:** [February 8, 2013, 12:03pm UTC](https://discuss.elastic.co/t/custom-similarity-setting-does-not-work-with-version-0-20-2/10662/9 "2013-02-08T12:03:47Z")

</div>

I have token filter. But not query parser. I use more like this query  
directly. I will not use token payloads on query, I want to use token  
payloads stored by filter on index time. Do I still need a query parser  
even if I use more like this query?

On Fri, Feb 8, 2013 at 1:43 PM, benjamin leviant \<[benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)

> wrote:

> Your implementation looks good.
> 
> But to get payload working in elasticsearch, a custom similarity is not  
> enough.
> 
> You need also to implement several custom elements :
> 
> - a token filter : to index payload values
> - a query parser : to score using payload values
> 
> Do you have all these elements working ?
> 
> Regards
> 
> Benjamin
> 
> On Fri, Feb 8, 2013 at 12:15 PM, Mustafa Sener [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)wrote:
> 
> > I use a FloatingPayload filter to create payloads for each term which is  
> > separated by '|' character (school|5.8). Then I use following similarity
> > 
> > [gist:4738207 · GitHub](https://gist.github.com/anonymous/4738207)
> > 
> > On Fri, Feb 8, 2013 at 12:27 PM, benjamin leviant \<  
> > [benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:
> > 
> > > I use a custom similarity on Elasticsearch 0.20.1 and it work perfectly  
> > > well.
> > > 
> > > If you dont have any error message when you create your index, then your  
> > > custom similarity should be enable for search and index operations on this  
> > > index.
> > > 
> > > May be your problem is caused by the way your similarity provider is  
> > > implemented. Can you post the code ?
> > > 
> > > Regards
> > > 
> > > Benjamin
> > > 
> > > On Fri, Feb 8, 2013 at 11:00 AM, Mustafa Sener [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)wrote:
> > > 
> > > > I have no error messages. It seems that this setting is different  
> > > > before version 0.20. Since there is no documentation about this, I cannot  
> > > > configure it properly.
> > > > 
> > > > On Fri, Feb 8, 2013 at 11:42 AM, benjamin leviant \<  
> > > > [benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:
> > > > 
> > > > > Hi,
> > > > > 
> > > > > What is your the error message ?
> > > > > 
> > > > > How do you get your custom class loaded ?
> > > > > 
> > > > > Regards
> > > > > 
> > > > > Benjamin
> > > > > 
> > > > > On Fri, Feb 8, 2013 at 9:40 AM, Mustafa Sener \<[mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)
> > > > > 
> > > > > > wrote:
> > > > > 
> > > > > > That does not work too. I tried it before.
> > > > > > 
> > > > > > On Fri, Feb 8, 2013 at 10:33 AM, benjamin leviant \<  
> > > > > > [benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:
> > > > > > 
> > > > > > > Hello,
> > > > > > > 
> > > > > > > you should try this command :
> > > > > > > 
> > > > > > > curl -XPOST '[http://host](http://host):port  
> > > > > > > /tweeter/' -d '  
> > > > > > > {  
> > > > > > > "settings": {  
> > > > > > > "index": {
> > > > > > > 
> > > > > > > ```
> > > > > > > "similarity": {
> > > > > > > "index": {
> > > > > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"
> > > > > > > },
> > > > > > > "search": {
> > > > > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"
> > > > > > > }
> > > > > > > }
> > > > > > > }
> > > > > > > }
> > > > > > > 
> > > > > > > ```
> > > > > > > 
> > > > > > > }
> > > > > > > 
> > > > > > > I hope it can help you.
> > > > > > > 
> > > > > > > Regards
> > > > > > > 
> > > > > > > Benjamin
> > > > > > > 
> > > > > > > On Fri, Feb 8, 2013 at 7:47 AM, Mustafa Sener \<  
> > > > > > > [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)\> wrote:
> > > > > > > 
> > > > > > > > Hi,  
> > > > > > > > I tried following configurations for my custom similarity provider  
> > > > > > > > but none of them worked with version 0.20. Can anyone give me some  
> > > > > > > > information about this setting for version 0.20.2? Any sample usages will  
> > > > > > > > be enough for me
> > > > > > > > 
> > > > > > > > curl -XPOST '[http://host](http://host):port/tweeter/' -d '  
> > > > > > > > {  
> > > > > > > > "settings": {  
> > > > > > > > "similarity": {  
> > > > > > > > "index": {  
> > > > > > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"  
> > > > > > > > },  
> > > > > > > > "search": {  
> > > > > > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"  
> > > > > > > > }  
> > > > > > > > }  
> > > > > > > > }  
> > > > > > > > }
> > > > > > > > 
> > > > > > > > index.similarity.index.type  
> > > > > > > > index.similarity.search.type
> > > > > > > > 
> > > > > > > > None of these works.
> > > > > > > > 
> > > > > > > > Thanks...
> > > > > > > > 
> > > > > > > > --  
> > > > > > > > Mustafa Sener
> > > > > > > > 
> > > > > > > > --  
> > > > > > > > Mustafa Sener  
> > > > > > > > [www.ifountain.com](http://www.ifountain.com)
> > > > > > > > 
> > > > > > > > --  
> > > > > > > > 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).  
> > > > > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > > > > 
> > > > > > > --  
> > > > > > > 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).  
> > > > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > > > 
> > > > > > --  
> > > > > > Mustafa Sener  
> > > > > > [http://www.ifountain.com](http://www.ifountain.com)
> > > > > > 
> > > > > > --  
> > > > > > 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).  
> > > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > > 
> > > > > --  
> > > > > 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).  
> > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > 
> > > > --  
> > > > Mustafa Sener [http://www.ifountain.com](http://www.ifountain.com)
> > > > 
> > > > --  
> > > > 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).  
> > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > 
> > > --  
> > > 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).  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > --  
> > Mustafa Sener
> > 
> > --  
> > 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).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
Mustafa Sener [http://www.ifountain.com](http://www.ifountain.com)

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![benjamin\_leviant](https://avatars.discourse-cdn.com/v4/letter/b/919ad9/32.png) [@benjamin\_leviant](https://discuss.elastic.co/u/benjamin_leviant)\
**Post date:** [February 8, 2013, 1:20pm UTC](https://discuss.elastic.co/t/custom-similarity-setting-does-not-work-with-version-0-20-2/10662/10 "2013-02-08T13:20:55Z")

</div>

It is not working, because the "more like this" query do not call the  
scorePayload method to score the results.

To use payloads, you need a custom query parser with a query having a  
scoring method that take in account payloads.

You can see documentation about lucene PayloadTermQuery and  
PayloadNearQuery.

Regards

Benjamin

On Fri, Feb 8, 2013 at 1:03 PM, Mustafa Sener [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)wrote:

> I have token filter. But not query parser. I use more like this query  
> directly. I will not use token payloads on query, I want to use token  
> payloads stored by filter on index time. Do I still need a query parser  
> even if I use more like this query?
> 
> On Fri, Feb 8, 2013 at 1:43 PM, benjamin leviant \<  
> [benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:
> 
> > Your implementation looks good.
> > 
> > But to get payload working in elasticsearch, a custom similarity is not  
> > enough.
> > 
> > You need also to implement several custom elements :
> > 
> > - a token filter : to index payload values
> > - a query parser : to score using payload values
> > 
> > Do you have all these elements working ?
> > 
> > Regards
> > 
> > Benjamin
> > 
> > On Fri, Feb 8, 2013 at 12:15 PM, Mustafa Sener [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)wrote:
> > 
> > > I use a FloatingPayload filter to create payloads for each term which is  
> > > separated by '|' character (school|5.8). Then I use following similarity
> > > 
> > > [gist:4738207 · GitHub](https://gist.github.com/anonymous/4738207)
> > > 
> > > On Fri, Feb 8, 2013 at 12:27 PM, benjamin leviant \<  
> > > [benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:
> > > 
> > > > I use a custom similarity on Elasticsearch 0.20.1 and it work perfectly  
> > > > well.
> > > > 
> > > > If you dont have any error message when you create your index, then  
> > > > your custom similarity should be enable for search and index operations on  
> > > > this index.
> > > > 
> > > > May be your problem is caused by the way your similarity provider is  
> > > > implemented. Can you post the code ?
> > > > 
> > > > Regards
> > > > 
> > > > Benjamin
> > > > 
> > > > On Fri, Feb 8, 2013 at 11:00 AM, Mustafa Sener \<[mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)
> > > > 
> > > > > wrote:
> > > > 
> > > > > I have no error messages. It seems that this setting is different  
> > > > > before version 0.20. Since there is no documentation about this, I cannot  
> > > > > configure it properly.
> > > > > 
> > > > > On Fri, Feb 8, 2013 at 11:42 AM, benjamin leviant \<  
> > > > > [benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:
> > > > > 
> > > > > > Hi,
> > > > > > 
> > > > > > What is your the error message ?
> > > > > > 
> > > > > > How do you get your custom class loaded ?
> > > > > > 
> > > > > > Regards
> > > > > > 
> > > > > > Benjamin
> > > > > > 
> > > > > > On Fri, Feb 8, 2013 at 9:40 AM, Mustafa Sener \<  
> > > > > > [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)\> wrote:
> > > > > > 
> > > > > > > That does not work too. I tried it before.
> > > > > > > 
> > > > > > > On Fri, Feb 8, 2013 at 10:33 AM, benjamin leviant \<  
> > > > > > > [benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:
> > > > > > > 
> > > > > > > > Hello,
> > > > > > > > 
> > > > > > > > you should try this command :
> > > > > > > > 
> > > > > > > > curl -XPOST '[http://host](http://host):port  
> > > > > > > > /tweeter/' -d '  
> > > > > > > > {  
> > > > > > > > "settings": {  
> > > > > > > > "index": {
> > > > > > > > 
> > > > > > > > ```
> > > > > > > > "similarity": {
> > > > > > > > "index": {
> > > > > > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"
> > > > > > > > },
> > > > > > > > "search": {
> > > > > > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"
> > > > > > > > }
> > > > > > > > }
> > > > > > > > }
> > > > > > > > }
> > > > > > > > 
> > > > > > > > ```
> > > > > > > > 
> > > > > > > > }
> > > > > > > > 
> > > > > > > > I hope it can help you.
> > > > > > > > 
> > > > > > > > Regards
> > > > > > > > 
> > > > > > > > Benjamin
> > > > > > > > 
> > > > > > > > On Fri, Feb 8, 2013 at 7:47 AM, Mustafa Sener \<  
> > > > > > > > [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)\> wrote:
> > > > > > > > 
> > > > > > > > > Hi,  
> > > > > > > > > I tried following configurations for my custom similarity provider  
> > > > > > > > > but none of them worked with version 0.20. Can anyone give me some  
> > > > > > > > > information about this setting for version 0.20.2? Any sample usages will  
> > > > > > > > > be enough for me
> > > > > > > > > 
> > > > > > > > > curl -XPOST '[http://host](http://host):port/tweeter/' -d '  
> > > > > > > > > {  
> > > > > > > > > "settings": {  
> > > > > > > > > "similarity": {  
> > > > > > > > > "index": {  
> > > > > > > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"  
> > > > > > > > > },  
> > > > > > > > > "search": {  
> > > > > > > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"  
> > > > > > > > > }  
> > > > > > > > > }  
> > > > > > > > > }  
> > > > > > > > > }
> > > > > > > > > 
> > > > > > > > > index.similarity.index.type  
> > > > > > > > > index.similarity.search.type
> > > > > > > > > 
> > > > > > > > > None of these works.
> > > > > > > > > 
> > > > > > > > > Thanks...
> > > > > > > > > 
> > > > > > > > > --  
> > > > > > > > > Mustafa Sener
> > > > > > > > > 
> > > > > > > > > --  
> > > > > > > > > Mustafa Sener  
> > > > > > > > > [www.ifountain.com](http://www.ifountain.com)
> > > > > > > > > 
> > > > > > > > > --  
> > > > > > > > > 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).  
> > > > > > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > > > > > 
> > > > > > > > --  
> > > > > > > > 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).  
> > > > > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > > > > 
> > > > > > > --  
> > > > > > > Mustafa Sener  
> > > > > > > [http://www.ifountain.com](http://www.ifountain.com)
> > > > > > > 
> > > > > > > --  
> > > > > > > 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).  
> > > > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > > > 
> > > > > > --  
> > > > > > 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).  
> > > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > > 
> > > > > --  
> > > > > Mustafa Sener [http://www.ifountain.com](http://www.ifountain.com)
> > > > > 
> > > > > --  
> > > > > 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).  
> > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > 
> > > > --  
> > > > 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).  
> > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > 
> > > --  
> > > Mustafa Sener
> > > 
> > > --  
> > > 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).  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > --  
> > 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).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> Mustafa Sener [http://www.ifountain.com](http://www.ifountain.com)
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Mustafa\_Sener](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@Mustafa\_Sener](https://discuss.elastic.co/u/Mustafa_Sener)\
**Post date:** [February 8, 2013, 1:32pm UTC](https://discuss.elastic.co/t/custom-similarity-setting-does-not-work-with-version-0-20-2/10662/11 "2013-02-08T13:32:51Z")

</div>

Ok,  
Thanks for your help. It was very beneficial for me.

Regards...

On Fri, Feb 8, 2013 at 3:20 PM, benjamin leviant \<[benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)

> wrote:

> It is not working, because the "more like this" query do not call the  
> scorePayload method to score the results.
> 
> To use payloads, you need a custom query parser with a query having a  
> scoring method that take in account payloads.
> 
> You can see documentation about lucene PayloadTermQuery and  
> PayloadNearQuery.
> 
> Regards
> 
> Benjamin
> 
> On Fri, Feb 8, 2013 at 1:03 PM, Mustafa Sener [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)wrote:
> 
> > I have token filter. But not query parser. I use more like this query  
> > directly. I will not use token payloads on query, I want to use token  
> > payloads stored by filter on index time. Do I still need a query parser  
> > even if I use more like this query?
> > 
> > On Fri, Feb 8, 2013 at 1:43 PM, benjamin leviant \<  
> > [benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:
> > 
> > > Your implementation looks good.
> > > 
> > > But to get payload working in elasticsearch, a custom similarity is not  
> > > enough.
> > > 
> > > You need also to implement several custom elements :
> > > 
> > > - a token filter : to index payload values
> > > - a query parser : to score using payload values
> > > 
> > > Do you have all these elements working ?
> > > 
> > > Regards
> > > 
> > > Benjamin
> > > 
> > > On Fri, Feb 8, 2013 at 12:15 PM, Mustafa Sener [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)wrote:
> > > 
> > > > I use a FloatingPayload filter to create payloads for each term which  
> > > > is separated by '|' character (school|5.8). Then I use following similarity
> > > > 
> > > > [gist:4738207 · GitHub](https://gist.github.com/anonymous/4738207)
> > > > 
> > > > On Fri, Feb 8, 2013 at 12:27 PM, benjamin leviant \<  
> > > > [benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:
> > > > 
> > > > > I use a custom similarity on Elasticsearch 0.20.1 and it work  
> > > > > perfectly well.
> > > > > 
> > > > > If you dont have any error message when you create your index, then  
> > > > > your custom similarity should be enable for search and index operations on  
> > > > > this index.
> > > > > 
> > > > > May be your problem is caused by the way your similarity provider is  
> > > > > implemented. Can you post the code ?
> > > > > 
> > > > > Regards
> > > > > 
> > > > > Benjamin
> > > > > 
> > > > > On Fri, Feb 8, 2013 at 11:00 AM, Mustafa Sener \<  
> > > > > [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)\> wrote:
> > > > > 
> > > > > > I have no error messages. It seems that this setting is different  
> > > > > > before version 0.20. Since there is no documentation about this, I cannot  
> > > > > > configure it properly.
> > > > > > 
> > > > > > On Fri, Feb 8, 2013 at 11:42 AM, benjamin leviant \<  
> > > > > > [benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:
> > > > > > 
> > > > > > > Hi,
> > > > > > > 
> > > > > > > What is your the error message ?
> > > > > > > 
> > > > > > > How do you get your custom class loaded ?
> > > > > > > 
> > > > > > > Regards
> > > > > > > 
> > > > > > > Benjamin
> > > > > > > 
> > > > > > > On Fri, Feb 8, 2013 at 9:40 AM, Mustafa Sener \<  
> > > > > > > [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)\> wrote:
> > > > > > > 
> > > > > > > > That does not work too. I tried it before.
> > > > > > > > 
> > > > > > > > On Fri, Feb 8, 2013 at 10:33 AM, benjamin leviant \<  
> > > > > > > > [benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:
> > > > > > > > 
> > > > > > > > > Hello,
> > > > > > > > > 
> > > > > > > > > you should try this command :
> > > > > > > > > 
> > > > > > > > > curl -XPOST '[http://host](http://host):port  
> > > > > > > > > /tweeter/' -d '  
> > > > > > > > > {  
> > > > > > > > > "settings": {  
> > > > > > > > > "index": {
> > > > > > > > > 
> > > > > > > > > ```
> > > > > > > > > "similarity": {
> > > > > > > > > "index": {
> > > > > > > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"
> > > > > > > > > },
> > > > > > > > > "search": {
> > > > > > > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"
> > > > > > > > > }
> > > > > > > > > }
> > > > > > > > > }
> > > > > > > > > }
> > > > > > > > > 
> > > > > > > > > ```
> > > > > > > > > 
> > > > > > > > > }
> > > > > > > > > 
> > > > > > > > > I hope it can help you.
> > > > > > > > > 
> > > > > > > > > Regards
> > > > > > > > > 
> > > > > > > > > Benjamin
> > > > > > > > > 
> > > > > > > > > On Fri, Feb 8, 2013 at 7:47 AM, Mustafa Sener \<  
> > > > > > > > > [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)\> wrote:
> > > > > > > > > 
> > > > > > > > > > Hi,  
> > > > > > > > > > I tried following configurations for my custom similarity  
> > > > > > > > > > provider but none of them worked with version 0.20. Can anyone give me some  
> > > > > > > > > > information about this setting for version 0.20.2? Any sample usages will  
> > > > > > > > > > be enough for me
> > > > > > > > > > 
> > > > > > > > > > curl -XPOST '[http://host](http://host):port/tweeter/' -d '  
> > > > > > > > > > {  
> > > > > > > > > > "settings": {  
> > > > > > > > > > "similarity": {  
> > > > > > > > > > "index": {  
> > > > > > > > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"  
> > > > > > > > > > },  
> > > > > > > > > > "search": {  
> > > > > > > > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"  
> > > > > > > > > > }  
> > > > > > > > > > }  
> > > > > > > > > > }  
> > > > > > > > > > }
> > > > > > > > > > 
> > > > > > > > > > index.similarity.index.type  
> > > > > > > > > > index.similarity.search.type
> > > > > > > > > > 
> > > > > > > > > > None of these works.
> > > > > > > > > > 
> > > > > > > > > > Thanks...
> > > > > > > > > > 
> > > > > > > > > > --  
> > > > > > > > > > Mustafa Sener
> > > > > > > > > > 
> > > > > > > > > > --  
> > > > > > > > > > Mustafa Sener  
> > > > > > > > > > [www.ifountain.com](http://www.ifountain.com)
> > > > > > > > > > 
> > > > > > > > > > --  
> > > > > > > > > > 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).  
> > > > > > > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > > > > > > 
> > > > > > > > > --  
> > > > > > > > > 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).  
> > > > > > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > > > > > 
> > > > > > > > --  
> > > > > > > > Mustafa Sener  
> > > > > > > > [http://www.ifountain.com](http://www.ifountain.com)
> > > > > > > > 
> > > > > > > > --  
> > > > > > > > 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).  
> > > > > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > > > > 
> > > > > > > --  
> > > > > > > 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).  
> > > > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > > > 
> > > > > > --  
> > > > > > Mustafa Sener [http://www.ifountain.com](http://www.ifountain.com)
> > > > > > 
> > > > > > --  
> > > > > > 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).  
> > > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > > 
> > > > > --  
> > > > > 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).  
> > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > 
> > > > --  
> > > > Mustafa Sener
> > > > 
> > > > --  
> > > > 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).  
> > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > 
> > > --  
> > > 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).  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > --  
> > Mustafa Sener [http://www.ifountain.com](http://www.ifountain.com)
> > 
> > --  
> > 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).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
Mustafa Sener [http://www.ifountain.com](http://www.ifountain.com)

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Mustafa\_Sener](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@Mustafa\_Sener](https://discuss.elastic.co/u/Mustafa_Sener)\
**Post date:** [February 8, 2013, 1:51pm UTC](https://discuss.elastic.co/t/custom-similarity-setting-does-not-work-with-version-0-20-2/10662/12 "2013-02-08T13:51:27Z")

</div>

The best option here to use morelikethis query is modify it to take  
payloads into account. I think I can do this by sub-classing payload query  
and multiply tf value used by query by payload of that term. What do you  
think about this design? Actually I need a categorizer which when I enter a  
text will return best matching categories based on predefined terms and  
payloads for categories. I select more like this query for this purpose.  
Payloads are important because I will assign negative payloads to negative  
samples or terms.

On Fri, Feb 8, 2013 at 3:32 PM, Mustafa Sener [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)wrote:

> Ok,  
> Thanks for your help. It was very beneficial for me.
> 
> Regards...
> 
> On Fri, Feb 8, 2013 at 3:20 PM, benjamin leviant \<  
> [benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:
> 
> > It is not working, because the "more like this" query do not call the  
> > scorePayload method to score the results.
> > 
> > To use payloads, you need a custom query parser with a query having a  
> > scoring method that take in account payloads.
> > 
> > You can see documentation about lucene PayloadTermQuery and  
> > PayloadNearQuery.
> > 
> > Regards
> > 
> > Benjamin
> > 
> > On Fri, Feb 8, 2013 at 1:03 PM, Mustafa Sener [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)wrote:
> > 
> > > I have token filter. But not query parser. I use more like this query  
> > > directly. I will not use token payloads on query, I want to use token  
> > > payloads stored by filter on index time. Do I still need a query parser  
> > > even if I use more like this query?
> > > 
> > > On Fri, Feb 8, 2013 at 1:43 PM, benjamin leviant \<  
> > > [benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:
> > > 
> > > > Your implementation looks good.
> > > > 
> > > > But to get payload working in elasticsearch, a custom similarity is not  
> > > > enough.
> > > > 
> > > > You need also to implement several custom elements :
> > > > 
> > > > - a token filter : to index payload values
> > > > - a query parser : to score using payload values
> > > > 
> > > > Do you have all these elements working ?
> > > > 
> > > > Regards
> > > > 
> > > > Benjamin
> > > > 
> > > > On Fri, Feb 8, 2013 at 12:15 PM, Mustafa Sener \<[mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)
> > > > 
> > > > > wrote:
> > > > 
> > > > > I use a FloatingPayload filter to create payloads for each term which  
> > > > > is separated by '|' character (school|5.8). Then I use following similarity
> > > > > 
> > > > > [gist:4738207 · GitHub](https://gist.github.com/anonymous/4738207)
> > > > > 
> > > > > On Fri, Feb 8, 2013 at 12:27 PM, benjamin leviant \<  
> > > > > [benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:
> > > > > 
> > > > > > I use a custom similarity on Elasticsearch 0.20.1 and it work  
> > > > > > perfectly well.
> > > > > > 
> > > > > > If you dont have any error message when you create your index, then  
> > > > > > your custom similarity should be enable for search and index operations on  
> > > > > > this index.
> > > > > > 
> > > > > > May be your problem is caused by the way your similarity provider is  
> > > > > > implemented. Can you post the code ?
> > > > > > 
> > > > > > Regards
> > > > > > 
> > > > > > Benjamin
> > > > > > 
> > > > > > On Fri, Feb 8, 2013 at 11:00 AM, Mustafa Sener \<  
> > > > > > [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)\> wrote:
> > > > > > 
> > > > > > > I have no error messages. It seems that this setting is different  
> > > > > > > before version 0.20. Since there is no documentation about this, I cannot  
> > > > > > > configure it properly.
> > > > > > > 
> > > > > > > On Fri, Feb 8, 2013 at 11:42 AM, benjamin leviant \<  
> > > > > > > [benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:
> > > > > > > 
> > > > > > > > Hi,
> > > > > > > > 
> > > > > > > > What is your the error message ?
> > > > > > > > 
> > > > > > > > How do you get your custom class loaded ?
> > > > > > > > 
> > > > > > > > Regards
> > > > > > > > 
> > > > > > > > Benjamin
> > > > > > > > 
> > > > > > > > On Fri, Feb 8, 2013 at 9:40 AM, Mustafa Sener \<  
> > > > > > > > [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)\> wrote:
> > > > > > > > 
> > > > > > > > > That does not work too. I tried it before.
> > > > > > > > > 
> > > > > > > > > On Fri, Feb 8, 2013 at 10:33 AM, benjamin leviant \<  
> > > > > > > > > [benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:
> > > > > > > > > 
> > > > > > > > > > Hello,
> > > > > > > > > > 
> > > > > > > > > > you should try this command :
> > > > > > > > > > 
> > > > > > > > > > curl -XPOST '[http://host](http://host):port  
> > > > > > > > > > /tweeter/' -d '  
> > > > > > > > > > {  
> > > > > > > > > > "settings": {  
> > > > > > > > > > "index": {
> > > > > > > > > > 
> > > > > > > > > > ```
> > > > > > > > > > "similarity": {
> > > > > > > > > > "index": {
> > > > > > > > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"
> > > > > > > > > > },
> > > > > > > > > > "search": {
> > > > > > > > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"
> > > > > > > > > > }
> > > > > > > > > > }
> > > > > > > > > > }
> > > > > > > > > > }
> > > > > > > > > > 
> > > > > > > > > > ```
> > > > > > > > > > 
> > > > > > > > > > }
> > > > > > > > > > 
> > > > > > > > > > I hope it can help you.
> > > > > > > > > > 
> > > > > > > > > > Regards
> > > > > > > > > > 
> > > > > > > > > > Benjamin
> > > > > > > > > > 
> > > > > > > > > > On Fri, Feb 8, 2013 at 7:47 AM, Mustafa Sener \<  
> > > > > > > > > > [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)\> wrote:
> > > > > > > > > > 
> > > > > > > > > > > Hi,  
> > > > > > > > > > > I tried following configurations for my custom similarity  
> > > > > > > > > > > provider but none of them worked with version 0.20. Can anyone give me some  
> > > > > > > > > > > information about this setting for version 0.20.2? Any sample usages will  
> > > > > > > > > > > be enough for me
> > > > > > > > > > > 
> > > > > > > > > > > curl -XPOST '[http://host](http://host):port/tweeter/' -d '  
> > > > > > > > > > > {  
> > > > > > > > > > > "settings": {  
> > > > > > > > > > > "similarity": {  
> > > > > > > > > > > "index": {  
> > > > > > > > > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"  
> > > > > > > > > > > },  
> > > > > > > > > > > "search": {  
> > > > > > > > > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"  
> > > > > > > > > > > }  
> > > > > > > > > > > }  
> > > > > > > > > > > }  
> > > > > > > > > > > }
> > > > > > > > > > > 
> > > > > > > > > > > index.similarity.index.type  
> > > > > > > > > > > index.similarity.search.type
> > > > > > > > > > > 
> > > > > > > > > > > None of these works.
> > > > > > > > > > > 
> > > > > > > > > > > Thanks...
> > > > > > > > > > > 
> > > > > > > > > > > --  
> > > > > > > > > > > Mustafa Sener
> > > > > > > > > > > 
> > > > > > > > > > > --  
> > > > > > > > > > > Mustafa Sener  
> > > > > > > > > > > [www.ifountain.com](http://www.ifountain.com)
> > > > > > > > > > > 
> > > > > > > > > > > --  
> > > > > > > > > > > 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).  
> > > > > > > > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out)  
> > > > > > > > > > > .
> > > > > > > > > > 
> > > > > > > > > > --  
> > > > > > > > > > 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).  
> > > > > > > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > > > > > > 
> > > > > > > > > --  
> > > > > > > > > Mustafa Sener  
> > > > > > > > > [http://www.ifountain.com](http://www.ifountain.com)
> > > > > > > > > 
> > > > > > > > > --  
> > > > > > > > > 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).  
> > > > > > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > > > > > 
> > > > > > > > --  
> > > > > > > > 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).  
> > > > > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > > > > 
> > > > > > > --  
> > > > > > > Mustafa Sener [http://www.ifountain.com](http://www.ifountain.com)
> > > > > > > 
> > > > > > > --  
> > > > > > > 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).  
> > > > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > > > 
> > > > > > --  
> > > > > > 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).  
> > > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > > 
> > > > > --  
> > > > > Mustafa Sener
> > > > > 
> > > > > --  
> > > > > 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).  
> > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > 
> > > > --  
> > > > 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).  
> > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > 
> > > --  
> > > Mustafa Sener [http://www.ifountain.com](http://www.ifountain.com)
> > > 
> > > --  
> > > 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).  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > --  
> > 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).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> Mustafa Sener [http://www.ifountain.com](http://www.ifountain.com)

--  
Mustafa Sener [http://www.ifountain.com](http://www.ifountain.com)

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![benjamin\_leviant](https://avatars.discourse-cdn.com/v4/letter/b/919ad9/32.png) [@benjamin\_leviant](https://discuss.elastic.co/u/benjamin_leviant)\
**Post date:** [February 8, 2013, 3:41pm UTC](https://discuss.elastic.co/t/custom-similarity-setting-does-not-work-with-version-0-20-2/10662/13 "2013-02-08T15:41:23Z")

</div>

Yes you can try by subclassing morelikethis query to customize its scoring  
logic.

Sorry, but I cannot confirm you it will be work.

Please, give us update on this.

Regards

On Fri, Feb 8, 2013 at 2:51 PM, Mustafa Sener [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)wrote:

> The best option here to use morelikethis query is modify it to take  
> payloads into account. I think I can do this by sub-classing payload query  
> and multiply tf value used by query by payload of that term. What do you  
> think about this design? Actually I need a categorizer which when I enter a  
> text will return best matching categories based on predefined terms and  
> payloads for categories. I select more like this query for this purpose.  
> Payloads are important because I will assign negative payloads to negative  
> samples or terms.
> 
> On Fri, Feb 8, 2013 at 3:32 PM, Mustafa Sener [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)wrote:
> 
> > Ok,  
> > Thanks for your help. It was very beneficial for me.
> > 
> > Regards...
> > 
> > On Fri, Feb 8, 2013 at 3:20 PM, benjamin leviant \<  
> > [benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:
> > 
> > > It is not working, because the "more like this" query do not call the  
> > > scorePayload method to score the results.
> > > 
> > > To use payloads, you need a custom query parser with a query having a  
> > > scoring method that take in account payloads.
> > > 
> > > You can see documentation about lucene PayloadTermQuery and  
> > > PayloadNearQuery.
> > > 
> > > Regards
> > > 
> > > Benjamin
> > > 
> > > On Fri, Feb 8, 2013 at 1:03 PM, Mustafa Sener [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)wrote:
> > > 
> > > > I have token filter. But not query parser. I use more like this query  
> > > > directly. I will not use token payloads on query, I want to use token  
> > > > payloads stored by filter on index time. Do I still need a query parser  
> > > > even if I use more like this query?
> > > > 
> > > > On Fri, Feb 8, 2013 at 1:43 PM, benjamin leviant \<  
> > > > [benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:
> > > > 
> > > > > Your implementation looks good.
> > > > > 
> > > > > But to get payload working in elasticsearch, a custom similarity is  
> > > > > not enough.
> > > > > 
> > > > > You need also to implement several custom elements :
> > > > > 
> > > > > - a token filter : to index payload values
> > > > > - a query parser : to score using payload values
> > > > > 
> > > > > Do you have all these elements working ?
> > > > > 
> > > > > Regards
> > > > > 
> > > > > Benjamin
> > > > > 
> > > > > On Fri, Feb 8, 2013 at 12:15 PM, Mustafa Sener \<  
> > > > > [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)\> wrote:
> > > > > 
> > > > > > I use a FloatingPayload filter to create payloads for each term which  
> > > > > > is separated by '|' character (school|5.8). Then I use following similarity
> > > > > > 
> > > > > > [gist:4738207 · GitHub](https://gist.github.com/anonymous/4738207)
> > > > > > 
> > > > > > On Fri, Feb 8, 2013 at 12:27 PM, benjamin leviant \<  
> > > > > > [benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:
> > > > > > 
> > > > > > > I use a custom similarity on Elasticsearch 0.20.1 and it work  
> > > > > > > perfectly well.
> > > > > > > 
> > > > > > > If you dont have any error message when you create your index, then  
> > > > > > > your custom similarity should be enable for search and index operations on  
> > > > > > > this index.
> > > > > > > 
> > > > > > > May be your problem is caused by the way your similarity provider is  
> > > > > > > implemented. Can you post the code ?
> > > > > > > 
> > > > > > > Regards
> > > > > > > 
> > > > > > > Benjamin
> > > > > > > 
> > > > > > > On Fri, Feb 8, 2013 at 11:00 AM, Mustafa Sener \<  
> > > > > > > [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)\> wrote:
> > > > > > > 
> > > > > > > > I have no error messages. It seems that this setting is different  
> > > > > > > > before version 0.20. Since there is no documentation about this, I cannot  
> > > > > > > > configure it properly.
> > > > > > > > 
> > > > > > > > On Fri, Feb 8, 2013 at 11:42 AM, benjamin leviant \<  
> > > > > > > > [benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:
> > > > > > > > 
> > > > > > > > > Hi,
> > > > > > > > > 
> > > > > > > > > What is your the error message ?
> > > > > > > > > 
> > > > > > > > > How do you get your custom class loaded ?
> > > > > > > > > 
> > > > > > > > > Regards
> > > > > > > > > 
> > > > > > > > > Benjamin
> > > > > > > > > 
> > > > > > > > > On Fri, Feb 8, 2013 at 9:40 AM, Mustafa Sener \<  
> > > > > > > > > [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)\> wrote:
> > > > > > > > > 
> > > > > > > > > > That does not work too. I tried it before.
> > > > > > > > > > 
> > > > > > > > > > On Fri, Feb 8, 2013 at 10:33 AM, benjamin leviant \<  
> > > > > > > > > > [benjamin.leviant@gmail.com](mailto:benjamin.leviant@gmail.com)\> wrote:
> > > > > > > > > > 
> > > > > > > > > > > Hello,
> > > > > > > > > > > 
> > > > > > > > > > > you should try this command :
> > > > > > > > > > > 
> > > > > > > > > > > curl -XPOST '[http://host](http://host):port  
> > > > > > > > > > > /tweeter/' -d '  
> > > > > > > > > > > {  
> > > > > > > > > > > "settings": {  
> > > > > > > > > > > "index": {
> > > > > > > > > > > 
> > > > > > > > > > > ```
> > > > > > > > > > > "similarity": {
> > > > > > > > > > > "index": {
> > > > > > > > > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"
> > > > > > > > > > > },
> > > > > > > > > > > "search": {
> > > > > > > > > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"
> > > > > > > > > > > }
> > > > > > > > > > > }
> > > > > > > > > > > }
> > > > > > > > > > > }
> > > > > > > > > > > 
> > > > > > > > > > > ```
> > > > > > > > > > > 
> > > > > > > > > > > }
> > > > > > > > > > > 
> > > > > > > > > > > I hope it can help you.
> > > > > > > > > > > 
> > > > > > > > > > > Regards
> > > > > > > > > > > 
> > > > > > > > > > > Benjamin
> > > > > > > > > > > 
> > > > > > > > > > > On Fri, Feb 8, 2013 at 7:47 AM, Mustafa Sener \<  
> > > > > > > > > > > [mustafa.sener@gmail.com](mailto:mustafa.sener@gmail.com)\> wrote:
> > > > > > > > > > > 
> > > > > > > > > > > > Hi,  
> > > > > > > > > > > > I tried following configurations for my custom similarity  
> > > > > > > > > > > > provider but none of them worked with version 0.20. Can anyone give me some  
> > > > > > > > > > > > information about this setting for version 0.20.2? Any sample usages will  
> > > > > > > > > > > > be enough for me
> > > > > > > > > > > > 
> > > > > > > > > > > > curl -XPOST '[http://host](http://host):port/tweeter/' -d '  
> > > > > > > > > > > > {  
> > > > > > > > > > > > "settings": {  
> > > > > > > > > > > > "similarity": {  
> > > > > > > > > > > > "index": {  
> > > > > > > > > > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"  
> > > > > > > > > > > > },  
> > > > > > > > > > > > "search": {  
> > > > > > > > > > > > "type": "org.elasticsearch.index.similarity.CustomSimilarityProvider"  
> > > > > > > > > > > > }  
> > > > > > > > > > > > }  
> > > > > > > > > > > > }  
> > > > > > > > > > > > }
> > > > > > > > > > > > 
> > > > > > > > > > > > index.similarity.index.type  
> > > > > > > > > > > > index.similarity.search.type
> > > > > > > > > > > > 
> > > > > > > > > > > > None of these works.
> > > > > > > > > > > > 
> > > > > > > > > > > > Thanks...
> > > > > > > > > > > > 
> > > > > > > > > > > > --  
> > > > > > > > > > > > Mustafa Sener
> > > > > > > > > > > > 
> > > > > > > > > > > > --  
> > > > > > > > > > > > Mustafa Sener  
> > > > > > > > > > > > [www.ifountain.com](http://www.ifountain.com)
> > > > > > > > > > > > 
> > > > > > > > > > > > --  
> > > > > > > > > > > > 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)  
> > > > > > > > > > > > .  
> > > > > > > > > > > > For more options, visit  
> > > > > > > > > > > > [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > > > > > > > > 
> > > > > > > > > > > --  
> > > > > > > > > > > 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).  
> > > > > > > > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out)  
> > > > > > > > > > > .
> > > > > > > > > > 
> > > > > > > > > > --  
> > > > > > > > > > Mustafa Sener  
> > > > > > > > > > [http://www.ifountain.com](http://www.ifountain.com)
> > > > > > > > > > 
> > > > > > > > > > --  
> > > > > > > > > > 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).  
> > > > > > > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > > > > > > 
> > > > > > > > > --  
> > > > > > > > > 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).  
> > > > > > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > > > > > 
> > > > > > > > --  
> > > > > > > > Mustafa Sener [http://www.ifountain.com](http://www.ifountain.com)
> > > > > > > > 
> > > > > > > > --  
> > > > > > > > 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).  
> > > > > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > > > > 
> > > > > > > --  
> > > > > > > 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).  
> > > > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > > > 
> > > > > > --  
> > > > > > Mustafa Sener
> > > > > > 
> > > > > > --  
> > > > > > 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).  
> > > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > > 
> > > > > --  
> > > > > 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).  
> > > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > > 
> > > > --  
> > > > Mustafa Sener [http://www.ifountain.com](http://www.ifountain.com)
> > > > 
> > > > --  
> > > > 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).  
> > > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > > 
> > > --  
> > > 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).  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > --  
> > Mustafa Sener [http://www.ifountain.com](http://www.ifountain.com)
> 
> --  
> Mustafa Sener [http://www.ifountain.com](http://www.ifountain.com)
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:52am UTC](https://discuss.elastic.co/t/custom-similarity-setting-does-not-work-with-version-0-20-2/10662/14 "2017-07-06T02:52:24Z")

</div>


