# Custom rescorer REST request example

**URL:** https://discuss.elastic.co/t/custom-rescorer-rest-request-example/113323
**Category:** Elasticsearch
**Created:** [December 27, 2017, 2:25pm UTC](https://discuss.elastic.co/t/custom-rescorer-rest-request-example/113323 "2017-12-27T14:25:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![vglazkov](https://avatars.discourse-cdn.com/v4/letter/v/ecc23a/32.png) [@vglazkov](https://discuss.elastic.co/u/vglazkov)
#### Post date: [December 27, 2017, 2:25pm UTC](https://discuss.elastic.co/t/custom-rescorer-rest-request-example/113323/1 "2017-12-27T14:25:49Z")

</div>

Hi,

I have a simple issue. I'm trying to create to my custom rescorer plugin and I've started with this elasticsearch out of the box example: [https://github.com/elastic/elasticsearch/blob/master/plugins/examples/rescore/src/main/java/org/elasticsearch/example/rescore/ExampleRescoreBuilder.java](https://github.com/elastic/elasticsearch/blob/master/plugins/examples/rescore/src/main/java/org/elasticsearch/example/rescore/ExampleRescoreBuilder.java)

I can successfully install my plugin in the elasticsearch, after that I'm starting elasticsearch client in the debug mode with the following command:

> ES\_JAVA\_OPTS="-Xdebug -Xrunjdwp:server=y,transport=dt\_socket,address=4000,suspend=y" ./elasticsearch

and I can successfully connect my debugger to the elasticsearch client and I can see that I'm hitting breakpoint inside my overriden method:

> public List\<RescorerSpec\<?\>\> getRescorers()

After that I'm trying to send request that will hit breakpoint in the rescore method. Here's the request (I took it from elasticsearch docs):

`POST /_search { "query" : { "match" : { "text" : { "operator" : "or", "query" : "The quick brown" } } }, "rescore" : { "window_size" : 50, "query" : { "rescore_query" : { "match_phrase" : { "text" : { "query" : "The quick brown", "slop" : 2 } } }, "query_weight" : 0.7, "rescore_query_weight" : 1.2 } } }`

but have no luck.

---

<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: [January 24, 2018, 2:26pm UTC](https://discuss.elastic.co/t/custom-rescorer-rest-request-example/113323/2 "2018-01-24T14:26:08Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
