# Inconsistency while search in ElasticSearch 2.0.0

**URL:** <https://discuss.elastic.co/t/inconsistency-while-search-in-elasticsearch-2-0-0/40932>\
**Category:** Elasticsearch\
**Created:** [February 4, 2016, 6:51am UTC](https://discuss.elastic.co/t/inconsistency-while-search-in-elasticsearch-2-0-0/40932 "2016-02-04T06:51:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![durgeshiitj](https://avatars.discourse-cdn.com/v4/letter/d/5f9b8f/32.png) [@durgeshiitj](https://discuss.elastic.co/u/durgeshiitj)\
**Post date:** [February 4, 2016, 6:51am UTC](https://discuss.elastic.co/t/inconsistency-while-search-in-elasticsearch-2-0-0/40932/1 "2016-02-04T06:51:18Z")

</div>

In my project I am doing 3 consecutive steps as **1- INDEXING, 2- SEARCHING, 3-DELETING.**  
My mapping::

> ```
> PUT _template/discoveryes
> {
> "template" : "discoveryes-*",
> 
> ```

> ```
> "settings" : {
> "number_of_shards" : 3,
> "number_of_replicas" : 0,
> "index": {
> "analysis": {
> "filter": {
> 							
> "en_stop_filter": {
> "type": "stop",
> "stopwords": ["_english_"]
> } , "en_stem_filter": {
> "type": "stemmer",
> "name": "english"
> }
> },
> "analyzer": {
> "en_analyzer": {
> "type": "custom",
> "filter": ["icu_normalizer", "en_stop_filter", "en_stem_filter", "icu_folding"],
> "tokenizer": "icu_tokenizer"
> },
> 							
> "default": {
> "type": "custom",
> "filter": ["icu_normalizer", "icu_folding"],
> "tokenizer": "icu_tokenizer"
> }
> }
> }
> }
> },   
> 
> ```

> ```
> "mappings" : {
> "discoveryes": {
> "_source" : { 
> "enabled" : "true" 
> },
> 						
> "properties" : {
> "witID" : {
> "type" : "string",
> "index" :"not_analyzed"
> },
> "text" : {
> "type" : "string",
> "analyzer" : "en_analyzer"
> },
> "docID":{
> "type":"string",
> "index" :"not_analyzed"
> }
> }
> }
> 					
> }
> }
> 
> ```

During my 1st operation, I am getting the correct result(means I am indexing few docs and searching some keywords which is giving me correct result and then deleting all the indexed ids).

But I am not getting the same result when I am trying to do the same operation again for same documents.

When I am commenting the delete operation and doing the operations then I am getting correct results everytime, but the problem arises when I include the DELETE operation.  
I am doing all these operation using Java.

Code for Search Operation :

```
SearchRequestBuilder searchBuilder = client
                                .prepareSearch()
                                .setIndices("discoveryes-1")
                                .setTypes("discoveryes").setQuery(qb)
                                .setSize(100);

```

Code for DELETE Operation :

```
DeleteResponse rsp = client.prepareDelete().setIndex("discoveryes-1").setType("discoveryes")
                    .setId(witID)
                    .execute()
                    .actionGet();
In the above line of code, the witID is the indexed ID based on which I am deleting.

```

Could I get some help regarding this?  
Thanks

---

<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, 11:19pm UTC](https://discuss.elastic.co/t/inconsistency-while-search-in-elasticsearch-2-0-0/40932/2 "2017-07-05T23:19:02Z")

</div>

Closed on July 5, 2017, 11:19pm UTC


