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 Answer 1

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);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.