Reindex select fields using Nest

I can't figure out how to re-index select fields using the Nest client for Elasticsearch. Basically, I want to do this:

POST _reindex
{
  "source": {
    "index": "twitter",
    "_source": ["user", "_doc"]
  },
  "dest": {
    "index": "new_twitter"
  }
}

and can't figure out what the Nest syntax is to specify the _source fields.

It looks like it's missing from ReindexOnServer(...) on the high level client. I've opened an issue to add it.

In the meantime, you can submit the request using the lowlevel client exposed on the high level, and still get back a high level response

var reindexResponse = client.LowLevel.Reindex<ReindexOnServerResponse>(@"{
      ""source"": {
        ""index"": ""twitter"",
        ""_source"": [""user"", ""_doc""]
      },
      ""dest"": {
        ""index"": ""new_twitter""
      }
    }");

Thank you. This is perfect.

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