# objSearch.getresult returns null

**URL:** <https://discuss.elastic.co/t/objsearch-getresult-returns-null/143483>\
**Category:** Elasticsearch\
**Created:** [August 8, 2018, 10:11am UTC](https://discuss.elastic.co/t/objsearch-getresult-returns-null/143483 "2018-08-08T10:11:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sebastiaan\_Leeflang](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@Sebastiaan\_Leeflang](https://discuss.elastic.co/u/Sebastiaan_Leeflang)\
**Post date:** [August 8, 2018, 10:11am UTC](https://discuss.elastic.co/t/objsearch-getresult-returns-null/143483/1 "2018-08-08T10:11:36Z")

</div>

UnitTestElasticsearchSample.Elasticsearch objSearch = new UnitTestElasticsearchSample.Elasticsearch();

\<  
objSearch.AddNewIndex(new City(1, "delhi", "delhi", "India", "9.879 million"));  
objSearch.AddNewIndex(new City(2, "mumbai", "Maharashtra", "India", "11.98 million"));  
objSearch.AddNewIndex(new City(3, "chenai", "Tamil Nadu", "India", "4.334 million"));  
objSearch.AddNewIndex(new City(4, "kolkata", "W. Bengal", "India", "4.573 million"));  
objSearch.AddNewIndex(new City(4, "Banglore", "Karnataka", "India", "4.302 million"));  
objSearch.AddNewIndex(new City(4, "Pune", "Maharashtra", "India", "2.538 million"));  
var test = objSearch.GetResult();  
/\>  
why is test null?

---

<div class="post-metadata">

**Author:** ![Sebastiaan\_Leeflang](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@Sebastiaan\_Leeflang](https://discuss.elastic.co/u/Sebastiaan_Leeflang)\
**Post date:** [August 8, 2018, 10:12am UTC](https://discuss.elastic.co/t/objsearch-getresult-returns-null/143483/2 "2018-08-08T10:12:48Z")

</div>

```
    public Elasticsearch()
    {
        var uri = new Uri("http://localhost:9200");
        var settings = new ConnectionSettings(uri);
        client = new ElasticClient(settings);
        settings.DefaultIndex("city");
    }
```

---

<div class="post-metadata">

**Author:** ![Sebastiaan\_Leeflang](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@Sebastiaan\_Leeflang](https://discuss.elastic.co/u/Sebastiaan_Leeflang)\
**Post date:** [August 8, 2018, 2:48pm UTC](https://discuss.elastic.co/t/objsearch-getresult-returns-null/143483/3 "2018-08-08T14:48:08Z")

</div>

it goes down on the indexexist("city")

is there a way to see what index's there are ?

---

<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:** [September 5, 2018, 2:48pm UTC](https://discuss.elastic.co/t/objsearch-getresult-returns-null/143483/4 "2018-09-05T14:48:11Z")

</div>

Closed on September 5, 2018, 2:48pm UTC

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