# When do we need to close and open the index in Elastic search

**URL:** https://discuss.elastic.co/t/when-do-we-need-to-close-and-open-the-index-in-elastic-search/98898
**Category:** Elasticsearch
**Created:** [August 30, 2017, 5:06pm UTC](https://discuss.elastic.co/t/when-do-we-need-to-close-and-open-the-index-in-elastic-search/98898 "2017-08-30T17:06:32Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Ramchandram](https://avatars.discourse-cdn.com/v4/letter/r/b3f665/32.png) [@Ramchandram](https://discuss.elastic.co/u/Ramchandram)
#### Post date: [August 30, 2017, 5:06pm UTC](https://discuss.elastic.co/t/when-do-we-need-to-close-and-open-the-index-in-elastic-search/98898/1 "2017-08-30T17:06:33Z")

</div>

Hi guys, I have applied analyzer to the index. After that do we need to close and open the index in Elastic search to see the old documents.

---

<div class="post-metadata">

### Author: ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)
#### Post date: [August 31, 2017, 1:34am UTC](https://discuss.elastic.co/t/when-do-we-need-to-close-and-open-the-index-in-elastic-search/98898/2 "2017-08-31T01:34:09Z")

</div>

The open/close API is just for management. It is not required to open nor close an index through it's lifetime.

I am also not understanding your question. Are you saying that you have changed/updated the index analyzer settings?

---

<div class="post-metadata">

### Author: ![Ramchandram](https://avatars.discourse-cdn.com/v4/letter/r/b3f665/32.png) [@Ramchandram](https://discuss.elastic.co/u/Ramchandram)
#### Post date: [August 31, 2017, 1:48pm UTC](https://discuss.elastic.co/t/when-do-we-need-to-close-and-open-the-index-in-elastic-search/98898/3 "2017-08-31T13:48:50Z")

</div>

Actually, Document is having below two fields:

receiver (With value as AN)  
2.receiver\_company(With value as AN RailXXX)  
When i search with receiver\_company, i could see the receiver value as AN in the output. Here is the query:  
{  
“from”: 0,  
“size”: 1,  
“query”: {  
“bool”: {  
“must”: [  
{  
“match”: {  
“receiver\_company”: {  
“query”: “AN RailXXX”,  
“type”: “boolean”  
}  
}  
}  
]  
}  
}  
}

but, i could not able to search with the field as receiver and the value as AN. Here is the query:  
{  
“from”: 0,  
“size”: 1,  
“query”: {  
“bool”: {  
“must”: [  
{  
“match”: {  
“receiver”: {  
“query”: “AN”,  
“type”: “boolean”  
}  
}  
}  
]  
}  
}  
}

So we created one analyzer which will disable the stop words and applied on the index. After that, we have added some new documents, which contains stop words. I have executed the second query, we only see new documents. What is the process to see the old documents, which had stop words.

---

<div class="post-metadata">

### Author: ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)
#### Post date: [August 31, 2017, 5:31pm UTC](https://discuss.elastic.co/t/when-do-we-need-to-close-and-open-the-index-in-elastic-search/98898/4 "2017-08-31T17:31:00Z")

</div>

Any changes made to analyzer will be only visible to new documents as the old documents are already processed by the old settings (when stopwords were enabled).

The only way to fix this is by reindexing. I suggest that you create a new index with the proper analyzer settings and reindex everything.

---

<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 28, 2017, 5:31pm UTC](https://discuss.elastic.co/t/when-do-we-need-to-close-and-open-the-index-in-elastic-search/98898/5 "2017-09-28T17:31:23Z")

</div>

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