Reindex select fields using Nest


(Brian Campbell) #1

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.


(Russ Cam) #2

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""
      }
    }");

(Brian Campbell) #3

Thank you. This is perfect.


(system) #4

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