Reindex using NEST v5.4

(natsu) #1


I'm quite new to ElasticSearch. I'm trying to reindex a index in order to rename it. I'm using NEST API v5.4.
I saw this example:

var reindex =
	elasticClient.Reindex<Customer>(r =>
        	.Query(q => q.MatchAll())
        	.CreateIndex(i =>
            	i.AddMapping<Customer>(m =>
                	m.Properties(p =>
                    	p.String(n => n.Name(name => name.Zipcode).Index(FieldIndexOption.not_analyzed))))));


However, I can't reproduce this using NEST 5.4. I think that is to version 2.4.
I check the breaking changes of ElasticSearch and try reindexing using this:

public method Nest.ReindexDescriptor..ctor Declaration changed (Breaking)
2.x: public .ctor(IndexName from, IndexName to) 5.x: public .ctor()

var reindex = new client.Reindex(oldIndexName, newIndexName);

But this did not work to.
I also search for documentation but i didn't find any code on c#, just JSON
Can someone give me a example how to reindex using NEST 5.4 on C#?

Thanks in advance! :slight_smile:

(Russ Cam) #2

You can use the Reindex API within NEST to reindex data from one index to another

var reindexResponse = client.ReindexOnServer(r => r
    .Source(s => s
    .Destination(d => d

(system) #3

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