ES Native (Java) Script error


I've been struggling with the Native (Java) script for some time now. I am writing custom score plugin and building with Maven. My java class looks like this

package org.elasticsearch.plugin.hw.customscore;

import java.util.Collections;
import java.util.List;
import java.util.Map;

import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.plugins.ScriptPlugin;
import org.elasticsearch.common.Nullable;
import org.elasticsearch.script.*;

public class HW_NativeScriptPlugin extends Plugin implements ScriptPlugin {

public List<NativeScriptFactory> getNativeScripts() {
    return Collections.singletonList(new HW_NativeScriptFactory());

public static class HW_NativeScriptFactory implements NativeScriptFactory {
    public ExecutableScript newScript(@Nullable Map<String, Object> params) {
        return new HW_NativeScript();
    public boolean needsScores() {
        return false;
    public String getName() {
        return "HW_SCRIPT";

public static class HW_NativeScript extends AbstractDoubleSearchScript {
    public double runAsDouble() {
        double a = 1;
        double b = 2;
        return a * b;


pom.xml ->

<project xmlns="" xmlns:xsi=""
  xsi:schemaLocation="    v4_0_0.xsd">
</project> ->

description=Custom score script for peopleworld

I m getting the following error while building my project

[ERROR] E:\ESPlugin\NativeScriptPlugin\src\main\java\org\elasticsearch\plugin\hw\customscore\[16,40] error: incompatible types: List<HW_NativeScriptFactory> cannot be converted to List
[ERROR] -> [Help 1]

Can anybody point out what am i doing wrong here ?


can you provide full error messages? Also is there a stack trace in the logs or the console when starting up? What content is in line 16 of the Plugin?


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