NEST High level querying custom plugin

Hey everyone, so I've done a scoring plugin for Elasticsearch, but I've been having a hard time trying to get it to work with NEST at high level as a function score.
I'm trying to get NEST to query my Elasticsearch cluster just like below.

POST index/_search
{
   "query": {
      "function_score": {
         "my-custom-plugin": {
            "foo" : "elastic_foo",
            "bar" : "elastic_bar",
         }
      }
   }
}

Problem is, I couldn't find any online material telling how to do it, I've tried to create my own IScoreFunction, and use it as stated below, but got no success with it, in the request json functions return as an empty array.

_esClient.Search<Object>(s => s
    .Query(q => q
        .FunctionScore(fs => fs
            .Functions(new List<IScoreFunction>
            {
                new MyCustomPlugin(new MyCustomPluginFields(){
                    Foo = _foo,
                    Bar = _bar,
                })
            })
        )
    )
);

Request JSON

{
  "query": {
    "function_score": {
      "functions": [
        {}
      ]
    }
  }
}

Has anyone ever tried something like this? How should I tackle this? Going low level is something I'm trying to avoid, as we have tons of queries being made using high level already.
Thanks in advance.

Hey everyone,
I've just found out that I had to be using netstandard2.0 for this to work properly. My query is well formed now and requests to Elasticsearch are working as expected.
Ty,

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