# How to get the equvalent of GET indexName using Nest .NET Library?

**URL:** <https://discuss.elastic.co/t/how-to-get-the-equvalent-of-get-indexname-using-nest-net-library/149571>\
**Category:** Elasticsearch\
**Created:** [September 22, 2018, 8:16pm UTC](https://discuss.elastic.co/t/how-to-get-the-equvalent-of-get-indexname-using-nest-net-library/149571 "2018-09-22T20:16:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rgelb](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@rgelb](https://discuss.elastic.co/u/rgelb)\
**Post date:** [September 22, 2018, 8:16pm UTC](https://discuss.elastic.co/t/how-to-get-the-equvalent-of-get-indexname-using-nest-net-library/149571/1 "2018-09-22T20:16:02Z")

</div>

When I run _GET indexName_ against ES, i get a definition of the index. How does one do that with the Nest library?

I've tried client.GetIndex but that doesn't seem to do the trick. And I don't see any metadata specific methods.

An example would be great.

---

<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:** [September 23, 2018, 2:14am UTC](https://discuss.elastic.co/t/how-to-get-the-equvalent-of-get-indexname-using-nest-net-library/149571/2 "2018-09-23T02:14:43Z")

</div>

Here are the index methods with NEST

```auto
var client = new ElasticClient();

// makes GET /<index> request
var getIndexResponse = client.GetIndex("<index>");

// makes GET /<index>/_settings request
var getIndexSettingsResponse = client.GetIndexSettings(i => i
    .Index("<index>")
);

// makes GET /<index>/_mapping request
var getMappingsResponse = client.GetMapping<object>(i => i
    .Index("<index>")
    .AllTypes()
);

```

---

<div class="post-metadata">

**Author:** ![rgelb](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@rgelb](https://discuss.elastic.co/u/rgelb)\
**Post date:** [September 24, 2018, 6:01pm UTC](https://discuss.elastic.co/t/how-to-get-the-equvalent-of-get-indexname-using-nest-net-library/149571/3 "2018-09-24T18:01:57Z")

</div>

@forloop This works generally, but for some indexes the call fails. I am on version 1.7.6 so that might be the problem.

For instance, _client.GetIndex(name);_ returns the following error:

`Could not convert string to boolean: no. Path 'index', line 1, position 181.`

Running _GET /valuations\_636727374057800495_ yields the following, so something can't be parsed properly.

{  
"valuations\_636727374057800495": {  
"aliases": {  
"valuations": {}  
},  
"mappings": {  
"propertyvaluation": {  
"properties": {  
"confidenceScore": {  
"type": "integer",  
"doc\_values": true  
},  
"estimatedMax": {  
"type": "integer",  
"index": "no"  
},  
"estimatedMin": {  
"type": "integer",  
"index": "no"  
},  
"estimatedValue": {  
"type": "integer",  
"index": "no"  
},  
"estimationDate": {  
"type": "date",  
"doc\_values": true,  
"format": "dateOptionalTime"  
},  
"fipsMuniCode": {  
"type": "short",  
"doc\_values": true  
},  
"fipsStateCode": {  
"type": "byte",  
"doc\_values": true  
},  
"fsdScore": {  
"type": "integer",  
"index": "no"  
},  
"latitude": {  
"type": "float",  
"doc\_values": true  
},  
"longitude": {  
"type": "float",  
"doc\_values": true  
},  
"parcelNumber": {  
"type": "string",  
"index": "not\_analyzed"  
},  
"pin": {  
"type": "geo\_point",  
"fielddata": {  
"loading": "eager"  
},  
"lat\_lon": true  
},  
"propertyId": {  
"type": "double",  
"doc\_values": true  
},  
"propertyValuationHistoryPoints": {  
"properties": {  
"date": {  
"type": "date",  
"index": "no",  
"format": "dateOptionalTime"  
},  
"value": {  
"type": "integer",  
"index": "no"  
}  
}  
},  
"trustClass": {  
"type": "string",  
"index": "no"  
}  
}  
}  
},  
"settings": {  
"index": {  
"creation\_date": "1537158527410",  
"number\_of\_shards": "6",  
"number\_of\_replicas": "1",  
"version": {  
"created": "1070699"  
},  
"uuid": "T06-C4TZRPKmKdaGc91HOw"  
}  
},  
"warmers": {}  
}  
}

---

<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:** [September 25, 2018, 10:47am UTC](https://discuss.elastic.co/t/how-to-get-the-equvalent-of-get-indexname-using-nest-net-library/149571/4 "2018-09-25T10:47:33Z")

</div>

What version of the NEST client are you using? NEST 1.x should be used with 1.7.6

---

<div class="post-metadata">

**Author:** ![rgelb](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@rgelb](https://discuss.elastic.co/u/rgelb)\
**Post date:** [September 25, 2018, 10:50pm UTC](https://discuss.elastic.co/t/how-to-get-the-equvalent-of-get-indexname-using-nest-net-library/149571/5 "2018-09-25T22:50:58Z")

</div>

I see. I'll just live with the errors since 1.x version is not code compatible with the latest NEST release.

---

<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:** [September 25, 2018, 11:22pm UTC](https://discuss.elastic.co/t/how-to-get-the-equvalent-of-get-indexname-using-nest-net-library/149571/6 "2018-09-25T23:22:52Z")

</div>

[Elasticsearch 1.x is compatible with NEST 1.x](https://github.com/elastic/elasticsearch-net#compatibility-matrix), so you must use the latest NEST 1.x release, which is [NEST 1.9.2](https://www.nuget.org/packages/NEST/1.9.2). Note that Elasticsearch 1.7.6 and NEST 1.x are both end of life.

The equivalent methods in NEST 1.9.2 are

```auto
// makes GET /<index> request
var getIndexResponse = client.GetIndex(i => i.Index("<index>"));

// makes GET /<index>/_settings request
var getIndexSettingsResponse = client.GetIndexSettings(i => i
    .Index("<index>")
);

// makes GET /<index>/_mapping request
var getMappingsResponse = client.GetMapping<object>(i => i
    .Index("<index>")
    .Type("")
);

```

---

<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:** [October 23, 2018, 11:22pm UTC](https://discuss.elastic.co/t/how-to-get-the-equvalent-of-get-indexname-using-nest-net-library/149571/7 "2018-10-23T23:22:53Z")

</div>

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