# Nest using system indices

**URL:** https://discuss.elastic.co/t/nest-using-system-indices/167684
**Category:** Elasticsearch
**Created:** [February 8, 2019, 8:31pm UTC](https://discuss.elastic.co/t/nest-using-system-indices/167684 "2019-02-08T20:31:50Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Marc-Antoine\_J](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marc-antoine_j/32/39687_2.png) [@Marc-Antoine\_J](https://discuss.elastic.co/u/Marc-Antoine_J)
#### Post date: [February 8, 2019, 8:31pm UTC](https://discuss.elastic.co/t/nest-using-system-indices/167684/1 "2019-02-08T20:31:50Z")

</div>

Hi all,

I'm trying to get my cluster stats out of the .monitoring-\* index with NEST and I can't get a result out so I was wondering if it does not allow querying system indices?

```
TermQuery termQuery = new TermQuery
{
     Field = "type",
     Value = "cluster_stats"
};  
response = await _client.SearchAsync<ElasticClusterStat>(s => s
                                              .From(0)
                                              .Size(1)
                                              .Index(".monitoring-*")
                                               .Query(q => q
                                                     .Term(tq => termQuery)
                                               )

```

);

I set my connection to provide details (from OnRequestCompleted) and I can see the request (JSON) passed and there no hits in the result. When I copy paste my request in my kibana console, I get thousands of hits...

Thanks,

---

<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: [February 10, 2019, 9:51am UTC](https://discuss.elastic.co/t/nest-using-system-indices/167684/2 "2019-02-10T09:51:51Z")

</div>

I suspect you also need to set `.Type(...)` with the document type in the .monitoring indices

---

<div class="post-metadata">

### Author: ![Marc-Antoine\_J](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marc-antoine_j/32/39687_2.png) [@Marc-Antoine\_J](https://discuss.elastic.co/u/Marc-Antoine_J)
#### Post date: [February 11, 2019, 1:05pm UTC](https://discuss.elastic.co/t/nest-using-system-indices/167684/3 "2019-02-11T13:05:33Z")

</div>

It did actually work! Why is that? The `.Type(...)` is always required? Isn't it going to be deprecated in 7.0.0 of elasticsearch?

Thanks @forloop

I was using the guide here: [https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/writing-queries.html](https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/writing-queries.html) and it did not specify that the document type had to be specified for a query.

---

<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: [February 11, 2019, 1:28pm UTC](https://discuss.elastic.co/t/nest-using-system-indices/167684/4 "2019-02-11T13:28:51Z")

</div>

Type is being deprecated, but it's still needed for 6.x.

In the absence of an explicit `.Type()` method call or any conventions set up on `ConnectionSettings` with

- `.DefaultTypeName()`
- .`.DefaultTypeNameInferrer()`
- use of `DataContractAttribute` or `ElasticsearchTypeAttribute` on the POCO type

NEST infers the type name by lowercasing the POCO type name. Check out [type inference](https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/types-and-relations-inference.html) for more details

---

<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: [March 11, 2019, 1:28pm UTC](https://discuss.elastic.co/t/nest-using-system-indices/167684/5 "2019-03-11T13:28:54Z")

</div>

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