Any way for an Elasticsearch plugin to override default api behavior?


I'm playing around with Elastic, and wondered if there's anyway to dynamically override a default endpoint behavior.

I tried creating a plugin which adds a BaseRestHandler, but when attempting to specify a route which was already used, the node failed to start with an exception, claiming it's already taken.

Looking into the code this seems to be intended, but I wandered if there's anything I'm missing.

Thanks :slight_smile:

Btw, I'm building the plugin with the following file, if there's something I'm missing out here:

import java.nio.file.Files

buildscript {
    repositories {

    dependencies {
        classpath "org.elasticsearch.gradle:build-tools:${elasticsearchVersion}"

group = 'com.dor.tests'
version = "${pluginVersion}.es.${elasticsearchVersion}-SNAPSHOT"

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'elasticsearch.esplugin'
apply plugin: 'elasticsearch.yaml-rest-test'
apply plugin: 'elasticsearch.testclusters'

licenseFile = rootProject.file('LICENSE')
noticeFile = rootProject.file('NOTICE')

processResources {
    filesMatching("**/") {

esplugin {
  licenseFile rootProject.file('LICENSE')
  noticeFile rootProject.file('NOTICE')

  name pluginName
  description pluginDesc
  classname pluginClassname

validateNebulaPom.enabled = false

dependencies {
  compile "com.fasterxml.jackson.core:jackson-databind:${jacksonDataBindVersion}"

testClusters.matching { == "runTask" }.configureEach {
  testDistribution = 'DEFAULT'

This is indeed on purpose. Please create a new endpoint that implements your custom behaviour.


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