0

I try to create memory index with following code but it creates regular index. Any idea?

    var node = new Uri("http://localhost:9200");
    var settings = new ConnectionSettings(node);
    var client = new Elasticsearch.Net.ElasticsearchClient(settings);
    var js = JsonConvert.SerializeObject("{settings: { index.store.type: memory}");
    var index = client.IndicesCreate("sampleIndex", js);

1 Answers1

0

Your second argument to the IndicesCreate method call is not correct. See the code below for a better way to achieve it. The first three lines are the same. In the fourth one, we properly create the settings for the index.

            _body = new {
                settings = new {
                    index = new {
                        store = new {
                            type = "memory"
                        }
                    }
                }
            };
            var index = client.IndicesCreate("sampleIndex", _body);
Val
  • 207,596
  • 13
  • 358
  • 360