# How to invoke custom rescorer plugin using elasticsearch-java 8 client

**URL:** https://discuss.elastic.co/t/how-to-invoke-custom-rescorer-plugin-using-elasticsearch-java-8-client/351868
**Category:** Elasticsearch
**Created:** [January 26, 2024, 9:27am UTC](https://discuss.elastic.co/t/how-to-invoke-custom-rescorer-plugin-using-elasticsearch-java-8-client/351868 "2024-01-26T09:27:49Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![baji](https://avatars.discourse-cdn.com/v4/letter/b/f04885/32.png) [@baji](https://discuss.elastic.co/u/baji)
#### Post date: [January 26, 2024, 9:27am UTC](https://discuss.elastic.co/t/how-to-invoke-custom-rescorer-plugin-using-elasticsearch-java-8-client/351868/1 "2024-01-26T09:27:49Z")

</div>

Hi,

I have migrated a custom rescorer plugin from Elasticsearch version 7 to 8. I can invoke the plugin using the following request. However, I am unable to generate a similar request using elasticsearch-java 8.10.4. I tried following the post linked below but I am getting `unknown query [customRescorer]` when I use wrapper query inside rescore\_query. It would be great if someone be able to share some pointers or a sample SearchRequest. Thanks.

```auto
{
  "_source": false,
  "query": {
    "match_all": {}
  },
  "rescore": [
    {
      "customRescorer": {
        "param1": 1,
        "param2": "name"
      },
      "window_size": 10
    }
  ],
  "size": 10
}

```

`Sample using wrapper: https://stackoverflow.com/questions/61367584/convert-rescore-json-query-to-java`

---

<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: [February 23, 2024, 9:28am UTC](https://discuss.elastic.co/t/how-to-invoke-custom-rescorer-plugin-using-elasticsearch-java-8-client/351868/2 "2024-02-23T09:28:27Z")

</div>

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