# Creating my own QueryBuilder

**URL:** <https://discuss.elastic.co/t/creating-my-own-querybuilder/103302>\
**Category:** Elasticsearch\
**Created:** [October 10, 2017, 6:32am UTC](https://discuss.elastic.co/t/creating-my-own-querybuilder/103302 "2017-10-10T06:32:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jpmantuano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpmantuano/32/21360_2.png) [@jpmantuano](https://discuss.elastic.co/u/jpmantuano)\
**Post date:** [October 10, 2017, 6:32am UTC](https://discuss.elastic.co/t/creating-my-own-querybuilder/103302/1 "2017-10-10T06:32:16Z")

</div>

I'm trying to integrate a 3rd party plugin into Elasticsearch.  
The query request I made including a 3rd party plugin is working properly via kibana. Then I tried to create my own QueryBuilder using the Elasticsearch's java API. I was able to recreate the query I needed but I receive this error ""Unknown NamedWriteable [org.elasticsearch.index.query.QueryBuilder][]""

Anyone can point me on what I can do next.

The party of the query I'm trying to customize is in the rescore portion:  
"rescore" : [  
{  
"window\_size" : 200,  
"query" : {  
"rescore\_query" : {  
"nested" : {  
"query" : {  
"function\_score" : {  
"3rdPartyFunction" : {  
"param1" : "parentField.childField",  
"param2" : "mike jones",  
"param3" : 1,  
"param4" : 0.5  
}  
}  
},  
"path" : "parentField",  
"ignore\_unmapped" : false,  
"score\_mode" : "max",  
"boost" : 1.0  
}  
},  
"query\_weight" : 0.0,  
"rescore\_query\_weight" : 1.0,  
"score\_mode" : "max"  
}  
}  
]

---

<div class="post-metadata">

**Author:** ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)\
**Post date:** [October 13, 2017, 7:06am UTC](https://discuss.elastic.co/t/creating-my-own-querybuilder/103302/2 "2017-10-13T07:06:24Z")

</div>

Did you register the query builder? Your plugin class will need to implement `SearchPlugin` interface and override the `getQueries()` method.

---

<div class="post-metadata">

**Author:** ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)\
**Post date:** [October 13, 2017, 7:17am UTC](https://discuss.elastic.co/t/creating-my-own-querybuilder/103302/3 "2017-10-13T07:17:24Z")

</div>

Your plugin needs to be installed on all your nodes in the cluster and the client that you use in your application.

---

<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:** [November 10, 2017, 7:17am UTC](https://discuss.elastic.co/t/creating-my-own-querybuilder/103302/4 "2017-11-10T07:17:33Z")

</div>

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