Created
June 16, 2014 06:20
-
-
Save ThomasArdal/ce32939ef1a5a079fed5 to your computer and use it in GitHub Desktop.
Create a new versioned Elasticsearch index
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var connectionSettings = new ConnectionSettings(new Uri("http://localhost:9200/")); | |
connectionSettings.SetDefaultIndex("customers"); | |
var elasticClient = new ElasticClient(connectionSettings); | |
elasticClient.CreateIndex("customers-v1"); | |
elasticClient.Alias(x => x.Add(a => a.Alias("customers").Index("customers-v1"))); | |
elasticClient.Map<Customer>(d => | |
d.Properties(p => p.Number(n => n.Name(name => name.Zipcode).Index(NonStringIndexOption.not_analyzed)))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment