# Nest Client Raw String

**URL:** <https://discuss.elastic.co/t/nest-client-raw-string/46459>\
**Category:** Elasticsearch\
**Created:** [April 5, 2016, 10:20pm UTC](https://discuss.elastic.co/t/nest-client-raw-string/46459 "2016-04-05T22:20:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Greenwell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_greenwell/32/62482_2.png) [@David\_Greenwell](https://discuss.elastic.co/u/David_Greenwell)\
**Post date:** [April 5, 2016, 10:20pm UTC](https://discuss.elastic.co/t/nest-client-raw-string/46459/1 "2016-04-05T22:20:54Z")

</div>

While upgrading to elastic 2.0 I am running into a snag.

In Nest 1.0, I could read an index's settings from a file and configure the index on creation using the raw string. Is there a way to the something similar in Nest 2.0 or do I have to use the fluent API for each setting including the analysis portion? The same question for mappings.

Nest 1.0

```
private bool CreateIndex(string index, FileInfo settingsFile)
{
    var settings = File.ReadAllText(settingsFile.FullName);

    IElasticsearchConnector _elastic
    var response = _elastic.Client.Raw.IndicesCreate(index, settings);

    if (!response.IsValid)
    {
        //Logging error
        return false
    
    }
    return true;
}
```

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [April 10, 2016, 9:33pm UTC](https://discuss.elastic.co/t/nest-client-raw-string/46459/2 "2016-04-10T21:33:07Z")

</div>

`IElasticClient.Raw`, the low level client available on the high level client, has been renamed to `IElastiClient.LowLevel` to better reflect what it is.

The similar call in NEST 2.x to what you want to do is

```auto
private bool CreateIndex(string index, FileInfo settingsFile)
{
    var settings = File.ReadAllText(settingsFile.FullName);

    var response = 
        _elastic.Client.LowLevel.IndicesCreate(index, settings);

    if (!response.Success)
    {
        //Log error
    }

    return response.Success;
}

```

---

<div class="post-metadata">

**Author:** ![David\_Greenwell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_greenwell/32/62482_2.png) [@David\_Greenwell](https://discuss.elastic.co/u/David_Greenwell)\
**Post date:** [April 18, 2016, 2:46pm UTC](https://discuss.elastic.co/t/nest-client-raw-string/46459/3 "2016-04-18T14:46:15Z")

</div>

Thank you for the help, that worked!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 10:58pm UTC](https://discuss.elastic.co/t/nest-client-raw-string/46459/4 "2017-07-05T22:58:27Z")

</div>


