# Why is elastic search client pointing to a different index while performing a search query

**URL:** <https://discuss.elastic.co/t/why-is-elastic-search-client-pointing-to-a-different-index-while-performing-a-search-query/49517>\
**Category:** Elasticsearch\
**Created:** [May 9, 2016, 6:33am UTC](https://discuss.elastic.co/t/why-is-elastic-search-client-pointing-to-a-different-index-while-performing-a-search-query/49517 "2016-05-09T06:33:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ASN](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asn/32/10535_2.png) [@ASN](https://discuss.elastic.co/u/ASN)\
**Post date:** [May 9, 2016, 6:33am UTC](https://discuss.elastic.co/t/why-is-elastic-search-client-pointing-to-a-different-index-while-performing-a-search-query/49517/1 "2016-05-09T06:33:32Z")

</div>

0  
down vote  
favorite  
Im trying to do a search operation on ElasticSearch. But when i call the search query , the client is pointing to some other index(which i used previously).

this is how im doing my settings.

```
configvalue1 = ConfigurationManager.AppSettings["url"];
            var pool = new SingleNodeConnectionPool(new Uri(configvalue1));
            var defaultIndex = "abc";

            settings = new ConnectionSettings(pool);
            client = new ElasticClient(settings);

            if (client.IndexExists(defaultIndex).Exists)
                client.DeleteIndex(defaultIndex);

            var createIndexResponse =
                client.CreateIndex(defaultIndex);

            return client;

```

Im using this client for some search operation.

`var callResult = client.LowLevel.Search<string>(a);`

When i check the callResult, Im getting a result from the documents that are indexed in a different index(for eg: zzz). Is there anything i have to do regarding this.

TIA

---

<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:53pm UTC](https://discuss.elastic.co/t/why-is-elastic-search-client-pointing-to-a-different-index-while-performing-a-search-query/49517/2 "2017-07-05T22:53:05Z")

</div>

Closed on July 5, 2017, 10:53pm UTC


