# Error while caching

**URL:** <https://discuss.elastic.co/t/error-while-caching/4748>\
**Category:** Elasticsearch\
**Created:** [July 1, 2011, 5:08am UTC](https://discuss.elastic.co/t/error-while-caching/4748 "2011-07-01T05:08:52Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![nachiket](https://avatars.discourse-cdn.com/v4/letter/n/4491bb/32.png) [@nachiket](https://discuss.elastic.co/u/nachiket)\
**Post date:** [July 1, 2011, 5:08am UTC](https://discuss.elastic.co/t/error-while-caching/4748/1 "2011-07-01T05:08:52Z")

</div>

Hi.  
My elastic search was working fine before I tried to configure cache  
filter. I tried to do this -\>

curl -XPUT localhost:9200/twitter/\_settings -d  
{  
"index" : {  
"number\_of\_replicas" : 4, "type":  
"node" ,"index.cache.filter.max\_size" : "20%" ,  
"index\_cache\_field\_expiry" : "5m"  
}  
}

And now I am unable to run evan a simple query. I get the message -\>  
{  
"error" : "SearchPhaseExecutionException[Failed to execute phase  
[query], total failure; shardFailures {[_na_][twitter][0]: No active  
shards}{[_na_][twitter][1]: No active shards}{[_na_][twitter][2]: No  
active shards}{[_na_][twitter][3]: No active shards}{[_na_][twitter]  
[4]: No active shards}]",  
"status" : 500  
}

Can somebody please help to understand what I did and how to fix it?

Regards.

---

<div class="post-metadata">

**Author:** ![nachiket](https://avatars.discourse-cdn.com/v4/letter/n/4491bb/32.png) [@nachiket](https://discuss.elastic.co/u/nachiket)\
**Post date:** [July 1, 2011, 5:27am UTC](https://discuss.elastic.co/t/error-while-caching/4748/2 "2011-07-01T05:27:06Z")

</div>

In logs I am getting this.

[2011-07-01 09:54:17,342][INFO][cluster.metadata] [Leash]  
Updating number\_of\_replicas to [4] for indices [test]  
[2011-07-01 09:54:49,865][WARN][http.netty] [Leash]  
Caught exception while handling client http traffic, closing  
connection  
java.lang.IllegalStateException: cannot send more responses than  
requests  
at  
org.elasticsearch.common.netty.handler.codec.http.HttpContentEncoder.writeRequested(HttpContentEncoder.java:  
102)  
at  
org.elasticsearch.common.netty.channel.SimpleChannelHandler.handleDownstream(SimpleChannelHandler.java:  
266)  
at  
org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:  
568)  
at  
org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:  
563)  
at  
org.elasticsearch.common.netty.channel.Channels.write(Channels.java:  
611)  
at  
org.elasticsearch.common.netty.channel.Channels.write(Channels.java:  
578)  
at  
org.elasticsearch.common.netty.channel.AbstractChannel.write(AbstractChannel.java:  
259)  
at  
org.elasticsearch.http.netty.NettyHttpChannel.sendResponse(NettyHttpChannel.java:  
144)  
at  
org.elasticsearch.rest.action.admin.indices.settings.RestUpdateSettingsAction  
$1.onResponse(RestUpdateSettingsAction.java:81)  
at  
org.elasticsearch.rest.action.admin.indices.settings.RestUpdateSettingsAction  
$1.onResponse(RestUpdateSettingsAction.java:74)  
at org.elasticsearch.action.support.BaseAction$ThreadedActionListener  
$1.run(BaseAction.java:84)  
at  
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:  
1110)  
at java.util.concurrent.ThreadPoolExecutor  
$Worker.run(ThreadPoolExecutor.java:603)  
at java.lang.Thread.run(Thread.java:679)

On Jul 1, 10:08 am, nachiket bhagwat [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)  
wrote:

> Hi.  
> My Elasticsearch was working fine before I tried to configure cache  
> filter. I tried to do this -\>
> 
> curl -XPUT localhost:9200/twitter/\_settings -d  
> {  
> "index" : {  
> "number\_of\_replicas" : 4, "type":  
> "node" ,"index.cache.filter.max\_size" : "20%" ,  
> "index\_cache\_field\_expiry" : "5m"  
> }
> 
> }
> 
> And now I am unable to run evan a simple query. I get the message -\>  
> {  
> "error" : "SearchPhaseExecutionException[Failed to execute phase  
> [query], total failure; shardFailures {[_na_][twitter][0]: No active  
> shards}{[_na_][twitter][1]: No active shards}{[_na_][twitter][2]: No  
> active shards}{[_na_][twitter][3]: No active shards}{[_na_][twitter]  
> [4]: No active shards}]",  
> "status" : 500
> 
> }
> 
> Can somebody please help to understand what I did and how to fix it?
> 
> Regards.

---

<div class="post-metadata">

**Author:** ![nachiket](https://avatars.discourse-cdn.com/v4/letter/n/4491bb/32.png) [@nachiket](https://discuss.elastic.co/u/nachiket)\
**Post date:** [July 1, 2011, 7:32am UTC](https://discuss.elastic.co/t/error-while-caching/4748/3 "2011-07-01T07:32:58Z")

</div>

Ok. I reinstalled Elasticsearch and did this

curl -XPUT localhost:9200/twitter/\_settings -d '  
{  
"index" : {  
"number\_of\_replicas" : 4, "type":  
"node" ,"index.cache.filter.max\_size" : "20%" ,  
"index\_cache\_field\_expiry" : "5m"  
}

} '

Then I did some changes in my elasticsearch.yml file. What i did was

index :  
analysis :  
analyzer :  
analyzer1 :  
type : custom  
tokenizer : tokenizer1  
filter : [filter2 , filter1 , filter5 , filter3]  
char\_filter : char\_filter1  
tokenizer :  
tokenizer1 :  
type : pattern  
pattern : "(\W\*,\W\*)|(\W_OR\W_)|(\W_AND\W_)|(\W\W\*)|(\d  
\d\*)"  
filter :  
filter1 :  
type : stop  
stopwords\_path : "stopwords.txt"  
filter2 :  
type : lowercase  
filter3 :  
type : synonym  
synonyms\_path : "/home/nachiket/Softwares/elasticsearch-0.16.2/  
config/synonym.txt"  
filter4 :  
type : stemmer  
language : minimal\_english  
filter5 :  
type : shingle  
max\_shingle\_size : 4  
char\_filter :  
char\_filter :  
char\_filter1 :  
type : html\_strip  
escaped\_tags : [xxx , yyy]  
read\_ahead : 1024

And I again started getting error message after any query:  
{"error":"SearchPhaseExecutionException[Failed to execute phase  
[query], total failure; shardFailures {[_na_][twitter][0]: No active  
shards}{[_na_][twitter][1]: No active shards}{[_na_][twitter][2]: No  
active shards}{[_na_][twitter][3]: No active shards}{[_na_][twitter]  
[4]: No active shards}]","status":500}

I am stuck in the middle of my work. Can somebody please help me with  
it ???

Regards.

On Jul 1, 10:27 am, nachiket bhagwat [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)  
wrote:

> In logs I am getting this.
> 
> [2011-07-01 09:54:17,342][INFO][cluster.metadata] [Leash]  
> Updating number\_of\_replicas to [4] for indices [test]  
> [2011-07-01 09:54:49,865][WARN][http.netty] [Leash]  
> Caught exception while handling client http traffic, closing  
> connection  
> java.lang.IllegalStateException: cannot send more responses than  
> requests  
> at  
> org.elasticsearch.common.netty.handler.codec.http.HttpContentEncoder.writeRequested(HttpContentEncoder.java:  
> 102)  
> at  
> org.elasticsearch.common.netty.channel.SimpleChannelHandler.handleDownstream(SimpleChannelHandler.java:  
> 266)  
> at  
> org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:  
> 568)  
> at  
> org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:  
> 563)  
> at  
> org.elasticsearch.common.netty.channel.Channels.write(Channels.java:  
> 611)  
> at  
> org.elasticsearch.common.netty.channel.Channels.write(Channels.java:  
> 578)  
> at  
> org.elasticsearch.common.netty.channel.AbstractChannel.write(AbstractChannel.java:  
> 259)  
> at  
> org.elasticsearch.http.netty.NettyHttpChannel.sendResponse(NettyHttpChannel.java:  
> 144)  
> at  
> org.elasticsearch.rest.action.admin.indices.settings.RestUpdateSettingsAction  
> $1.onResponse(RestUpdateSettingsAction.java:81)  
> at  
> org.elasticsearch.rest.action.admin.indices.settings.RestUpdateSettingsAction  
> $1.onResponse(RestUpdateSettingsAction.java:74)  
> at org.elasticsearch.action.support.BaseAction$ThreadedActionListener  
> $1.run(BaseAction.java:84)  
> at  
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:  
> 1110)  
> at java.util.concurrent.ThreadPoolExecutor  
> $Worker.run(ThreadPoolExecutor.java:603)  
> at java.lang.Thread.run(Thread.java:679)
> 
> On Jul 1, 10:08 am, nachiket bhagwat [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com)  
> wrote:
> 
> > Hi.  
> > My Elasticsearch was working fine before I tried to configure cache  
> > filter. I tried to do this -\>
> 
> > curl -XPUT localhost:9200/twitter/\_settings -d  
> > {  
> > "index" : {  
> > "number\_of\_replicas" : 4, "type":  
> > "node" ,"index.cache.filter.max\_size" : "20%" ,  
> > "index\_cache\_field\_expiry" : "5m"  
> > }
> 
> > }
> 
> > And now I am unable to run evan a simple query. I get the message -\>  
> > {  
> > "error" : "SearchPhaseExecutionException[Failed to execute phase  
> > [query], total failure; shardFailures {[_na_][twitter][0]: No active  
> > shards}{[_na_][twitter][1]: No active shards}{[_na_][twitter][2]: No  
> > active shards}{[_na_][twitter][3]: No active shards}{[_na_][twitter]  
> > [4]: No active shards}]",  
> > "status" : 500
> 
> > }
> 
> > Can somebody please help to understand what I did and how to fix it?
> 
> > Regards.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [July 1, 2011, 9:23am UTC](https://discuss.elastic.co/t/error-while-caching/4748/4 "2011-07-01T09:23:22Z")

</div>

How many nodes are you running? Do you see failures in the logs, you might be misconfiguring the index and it fails to create the shards.

On Friday, July 1, 2011 at 10:32 AM, nachiket bhagwat wrote:

> Ok. I reinstalled Elasticsearch and did this
> 
> curl -XPUT localhost:9200/twitter/\_settings -d '  
> {  
> "index" : {  
> "number\_of\_replicas" : 4, "type":  
> "node" ,"index.cache.filter.max\_size" : "20%" ,  
> "index\_cache\_field\_expiry" : "5m"  
> }
> 
> } '
> 
> Then I did some changes in my elasticsearch.yml file. What i did was
> 
> index :  
> analysis :  
> analyzer :  
> analyzer1 :  
> type : custom  
> tokenizer : tokenizer1  
> filter : [filter2 , filter1 , filter5 , filter3]  
> char\_filter : char\_filter1  
> tokenizer :  
> tokenizer1 :  
> type : pattern  
> pattern : "(\W\*,\W\*)|(\W_OR\W_)|(\W_AND\W_)|(\W\W\*)|(\d  
> \d\*)"  
> filter :  
> filter1 :  
> type : stop  
> stopwords\_path : "stopwords.txt"  
> filter2 :  
> type : lowercase  
> filter3 :  
> type : synonym  
> synonyms\_path : "/home/nachiket/Softwares/elasticsearch-0.16.2/  
> config/synonym.txt"  
> filter4 :  
> type : stemmer  
> language : minimal\_english  
> filter5 :  
> type : shingle  
> max\_shingle\_size : 4  
> char\_filter :  
> char\_filter :  
> char\_filter1 :  
> type : html\_strip  
> escaped\_tags : [xxx , yyy]  
> read\_ahead : 1024
> 
> And I again started getting error message after any query:  
> {"error":"SearchPhaseExecutionException[Failed to execute phase  
> [query], total failure; shardFailures {[_na_][twitter][0]: No active  
> shards}{[_na_][twitter][1]: No active shards}{[_na_][twitter][2]: No  
> active shards}{[_na_][twitter][3]: No active shards}{[_na_][twitter]  
> [4]: No active shards}]","status":500}
> 
> I am stuck in the middle of my work. Can somebody please help me with  
> it ???
> 
> Regards.
> 
> On Jul 1, 10:27 am, nachiket bhagwat \<[nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com) ([http://gmail.com](http://gmail.com))\>  
> wrote:
> 
> > In logs I am getting this.
> > 
> > [2011-07-01 09:54:17,342][INFO][cluster.metadata] [Leash]  
> > Updating number\_of\_replicas to [4] for indices [test]  
> > [2011-07-01 09:54:49,865][WARN][http.netty] [Leash]  
> > Caught exception while handling client http traffic, closing  
> > connection  
> > java.lang.IllegalStateException: cannot send more responses than  
> > requests  
> > at  
> > org.elasticsearch.common.netty.handler.codec.http.HttpContentEncoder.writeRequested(HttpContentEncoder.java:  
> > 102)  
> > at  
> > org.elasticsearch.common.netty.channel.SimpleChannelHandler.handleDownstream(SimpleChannelHandler.java:  
> > 266)  
> > at  
> > org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:  
> > 568)  
> > at  
> > org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:  
> > 563)  
> > at  
> > org.elasticsearch.common.netty.channel.Channels.write(Channels.java:  
> > 611)  
> > at  
> > org.elasticsearch.common.netty.channel.Channels.write(Channels.java:  
> > 578)  
> > at  
> > org.elasticsearch.common.netty.channel.AbstractChannel.write(AbstractChannel.java:  
> > 259)  
> > at  
> > org.elasticsearch.http.netty.NettyHttpChannel.sendResponse(NettyHttpChannel.java:  
> > 144)  
> > at  
> > org.elasticsearch.rest.action.admin.indices.settings.RestUpdateSettingsAction  
> > $1.onResponse(RestUpdateSettingsAction.java:81)  
> > at  
> > org.elasticsearch.rest.action.admin.indices.settings.RestUpdateSettingsAction  
> > $1.onResponse(RestUpdateSettingsAction.java:74)  
> > at org.elasticsearch.action.support.BaseAction$ThreadedActionListener  
> > $1.run(BaseAction.java:84)  
> > at  
> > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:  
> > 1110)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.run(ThreadPoolExecutor.java:603)  
> > at java.lang.Thread.run(Thread.java:679)
> > 
> > On Jul 1, 10:08 am, nachiket bhagwat \<[nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com) ([http://gmail.com](http://gmail.com))\>  
> > wrote:
> > 
> > > Hi.  
> > > My Elasticsearch was working fine before I tried to configure cache  
> > > filter. I tried to do this -\>
> > 
> > > curl -XPUT localhost:9200/twitter/\_settings -d  
> > > {  
> > > "index" : {  
> > > "number\_of\_replicas" : 4, "type":  
> > > "node" ,"index.cache.filter.max\_size" : "20%" ,  
> > > "index\_cache\_field\_expiry" : "5m"  
> > > }
> > 
> > > }
> > 
> > > And now I am unable to run evan a simple query. I get the message -\>  
> > > {  
> > > "error" : "SearchPhaseExecutionException[Failed to execute phase  
> > > [query], total failure; shardFailures {[_na_][twitter][0]: No active  
> > > shards}{[_na_][twitter][1]: No active shards}{[_na_][twitter][2]: No  
> > > active shards}{[_na_][twitter][3]: No active shards}{[_na_][twitter]  
> > > [4]: No active shards}]",  
> > > "status" : 500
> > 
> > > }
> > 
> > > Can somebody please help to understand what I did and how to fix it?
> > 
> > > Regards.

---

<div class="post-metadata">

**Author:** ![nachiket](https://avatars.discourse-cdn.com/v4/letter/n/4491bb/32.png) [@nachiket](https://discuss.elastic.co/u/nachiket)\
**Post date:** [July 1, 2011, 11:07am UTC](https://discuss.elastic.co/t/error-while-caching/4748/5 "2011-07-01T11:07:59Z")

</div>

Thanks a lot.  
I have just started looking into how to index and search with Elastic Search.  
But I couldn't find how to configure the index. I used one code from one of the replies on another topic.  
Can you tell me where to find it out?

---

<div class="post-metadata">

**Author:** ![nachiket](https://avatars.discourse-cdn.com/v4/letter/n/4491bb/32.png) [@nachiket](https://discuss.elastic.co/u/nachiket)\
**Post date:** [July 1, 2011, 11:10am UTC](https://discuss.elastic.co/t/error-while-caching/4748/6 "2011-07-01T11:10:08Z")

</div>

Thanks a lot.  
I am very new to Elastic Search and just started to learn how to  
search and index.  
But I couldn't figure out how to configure index. I configured it from  
response on another topic.  
Can you please tell me how to configure it?

On Jul 1, 2:23 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> How many nodes are you running? Do you see failures in the logs, you might be misconfiguring the index and it fails to create the shards.
> 
> On Friday, July 1, 2011 at 10:32 AM, nachiket bhagwat wrote:
> 
> > Ok. I reinstalled Elasticsearch and did this
> 
> > curl -XPUT localhost:9200/twitter/\_settings -d '  
> > {  
> > "index" : {  
> > "number\_of\_replicas" : 4, "type":  
> > "node" ,"index.cache.filter.max\_size" : "20%" ,  
> > "index\_cache\_field\_expiry" : "5m"  
> > }
> 
> > } '
> 
> > Then I did some changes in my elasticsearch.yml file. What i did was
> 
> > index :  
> > analysis :  
> > analyzer :  
> > analyzer1 :  
> > type : custom  
> > tokenizer : tokenizer1  
> > filter : [filter2 , filter1 , filter5 , filter3]  
> > char\_filter : char\_filter1  
> > tokenizer :  
> > tokenizer1 :  
> > type : pattern  
> > pattern : "(\W\*,\W\*)|(\W_OR\W_)|(\W_AND\W_)|(\W\W\*)|(\d  
> > \d\*)"  
> > filter :  
> > filter1 :  
> > type : stop  
> > stopwords\_path : "stopwords.txt"  
> > filter2 :  
> > type : lowercase  
> > filter3 :  
> > type : synonym  
> > synonyms\_path : "/home/nachiket/Softwares/elasticsearch-0.16.2/  
> > config/synonym.txt"  
> > filter4 :  
> > type : stemmer  
> > language : minimal\_english  
> > filter5 :  
> > type : shingle  
> > max\_shingle\_size : 4  
> > char\_filter :  
> > char\_filter :  
> > char\_filter1 :  
> > type : html\_strip  
> > escaped\_tags : [xxx , yyy]  
> > read\_ahead : 1024
> 
> > And I again started getting error message after any query:  
> > {"error":"SearchPhaseExecutionException[Failed to execute phase  
> > [query], total failure; shardFailures {[_na_][twitter][0]: No active  
> > shards}{[_na_][twitter][1]: No active shards}{[_na_][twitter][2]: No  
> > active shards}{[_na_][twitter][3]: No active shards}{[_na_][twitter]  
> > [4]: No active shards}]","status":500}
> 
> > I am stuck in the middle of my work. Can somebody please help me with  
> > it ???
> 
> > Regards.
> 
> > On Jul 1, 10:27 am, nachiket bhagwat \<[nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com) ([http://gmail.com](http://gmail.com))\>  
> > wrote:
> > 
> > > In logs I am getting this.
> 
> > > [2011-07-01 09:54:17,342][INFO][cluster.metadata] [Leash]  
> > > Updating number\_of\_replicas to [4] for indices [test]  
> > > [2011-07-01 09:54:49,865][WARN][http.netty] [Leash]  
> > > Caught exception while handling client http traffic, closing  
> > > connection  
> > > java.lang.IllegalStateException: cannot send more responses than  
> > > requests  
> > > at  
> > > org.elasticsearch.common.netty.handler.codec.http.HttpContentEncoder.writeRequested(HttpContentEncoder.java:  
> > > 102)  
> > > at  
> > > org.elasticsearch.common.netty.channel.SimpleChannelHandler.handleDownstream(SimpleChannelHandler.java:  
> > > 266)  
> > > at  
> > > org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:  
> > > 568)  
> > > at  
> > > org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:  
> > > 563)  
> > > at  
> > > org.elasticsearch.common.netty.channel.Channels.write(Channels.java:  
> > > 611)  
> > > at  
> > > org.elasticsearch.common.netty.channel.Channels.write(Channels.java:  
> > > 578)  
> > > at  
> > > org.elasticsearch.common.netty.channel.AbstractChannel.write(AbstractChannel.java:  
> > > 259)  
> > > at  
> > > org.elasticsearch.http.netty.NettyHttpChannel.sendResponse(NettyHttpChannel.java:  
> > > 144)  
> > > at  
> > > org.elasticsearch.rest.action.admin.indices.settings.RestUpdateSettingsAction  
> > > $1.onResponse(RestUpdateSettingsAction.java:81)  
> > > at  
> > > org.elasticsearch.rest.action.admin.indices.settings.RestUpdateSettingsAction  
> > > $1.onResponse(RestUpdateSettingsAction.java:74)  
> > > at org.elasticsearch.action.support.BaseAction$ThreadedActionListener  
> > > $1.run(BaseAction.java:84)  
> > > at  
> > > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:  
> > > 1110)  
> > > at java.util.concurrent.ThreadPoolExecutor  
> > > $Worker.run(ThreadPoolExecutor.java:603)  
> > > at java.lang.Thread.run(Thread.java:679)
> 
> > > On Jul 1, 10:08 am, nachiket bhagwat \<[nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com) ([http://gmail.com](http://gmail.com))\>  
> > > wrote:
> 
> > > > Hi.  
> > > > My Elasticsearch was working fine before I tried to configure cache  
> > > > filter. I tried to do this -\>
> 
> > > > curl -XPUT localhost:9200/twitter/\_settings -d  
> > > > {  
> > > > "index" : {  
> > > > "number\_of\_replicas" : 4, "type":  
> > > > "node" ,"index.cache.filter.max\_size" : "20%" ,  
> > > > "index\_cache\_field\_expiry" : "5m"  
> > > > }
> 
> > > > }
> 
> > > > And now I am unable to run evan a simple query. I get the message -\>  
> > > > {  
> > > > "error" : "SearchPhaseExecutionException[Failed to execute phase  
> > > > [query], total failure; shardFailures {[_na_][twitter][0]: No active  
> > > > shards}{[_na_][twitter][1]: No active shards}{[_na_][twitter][2]: No  
> > > > active shards}{[_na_][twitter][3]: No active shards}{[_na_][twitter]  
> > > > [4]: No active shards}]",  
> > > > "status" : 500
> 
> > > > }
> 
> > > > Can somebody please help to understand what I did and how to fix it?
> 
> > > > Regards.

---

<div class="post-metadata">

**Author:** ![nachiket](https://avatars.discourse-cdn.com/v4/letter/n/4491bb/32.png) [@nachiket](https://discuss.elastic.co/u/nachiket)\
**Post date:** [July 1, 2011, 12:37pm UTC](https://discuss.elastic.co/t/error-while-caching/4748/7 "2011-07-01T12:37:16Z")

</div>

When I am doing for new index  
curl -XPUT localhost:9200/twitter2 -d '{  
"settings" : {  
"index" : {  
"number\_of\_shards" : 1,  
"number\_of\_replicas" : "4"  
}  
}  
}'  
It is correctly indexing and searching.

But when I do it for existing index  
curl -XPUT localhost:9200/twitter -d '{  
"settings" : {  
"index" : {  
"number\_of\_shards" : 1,  
"number\_of\_replicas" : "4"  
}  
}  
}'  
It is giving  
{"error":"IndexAlreadyExistsException[[twitter] Already  
exists]","status":400}. How can I configure my index??

On Jul 1, 4:10 pm, nachiket bhagwat [nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com) wrote:

> Thanks a lot.  
> I am very new to Elastic Search and just started to learn how to  
> search and index.  
> But I couldn't figure out how to configure index. I configured it from  
> response on another topic.  
> Can you please tell me how to configure it?
> 
> On Jul 1, 2:23 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> 
> > How many nodes are you running? Do you see failures in the logs, you might be misconfiguring the index and it fails to create the shards.
> 
> > On Friday, July 1, 2011 at 10:32 AM, nachiket bhagwat wrote:
> > 
> > > Ok. I reinstalled Elasticsearch and did this
> 
> > > curl -XPUT localhost:9200/twitter/\_settings -d '  
> > > {  
> > > "index" : {  
> > > "number\_of\_replicas" : 4, "type":  
> > > "node" ,"index.cache.filter.max\_size" : "20%" ,  
> > > "index\_cache\_field\_expiry" : "5m"  
> > > }
> 
> > > } '
> 
> > > Then I did some changes in my elasticsearch.yml file. What i did was
> 
> > > index :  
> > > analysis :  
> > > analyzer :  
> > > analyzer1 :  
> > > type : custom  
> > > tokenizer : tokenizer1  
> > > filter : [filter2 , filter1 , filter5 , filter3]  
> > > char\_filter : char\_filter1  
> > > tokenizer :  
> > > tokenizer1 :  
> > > type : pattern  
> > > pattern : "(\W\*,\W\*)|(\W_OR\W_)|(\W_AND\W_)|(\W\W\*)|(\d  
> > > \d\*)"  
> > > filter :  
> > > filter1 :  
> > > type : stop  
> > > stopwords\_path : "stopwords.txt"  
> > > filter2 :  
> > > type : lowercase  
> > > filter3 :  
> > > type : synonym  
> > > synonyms\_path : "/home/nachiket/Softwares/elasticsearch-0.16.2/  
> > > config/synonym.txt"  
> > > filter4 :  
> > > type : stemmer  
> > > language : minimal\_english  
> > > filter5 :  
> > > type : shingle  
> > > max\_shingle\_size : 4  
> > > char\_filter :  
> > > char\_filter :  
> > > char\_filter1 :  
> > > type : html\_strip  
> > > escaped\_tags : [xxx , yyy]  
> > > read\_ahead : 1024
> 
> > > And I again started getting error message after any query:  
> > > {"error":"SearchPhaseExecutionException[Failed to execute phase  
> > > [query], total failure; shardFailures {[_na_][twitter][0]: No active  
> > > shards}{[_na_][twitter][1]: No active shards}{[_na_][twitter][2]: No  
> > > active shards}{[_na_][twitter][3]: No active shards}{[_na_][twitter]  
> > > [4]: No active shards}]","status":500}
> 
> > > I am stuck in the middle of my work. Can somebody please help me with  
> > > it ???
> 
> > > Regards.
> 
> > > On Jul 1, 10:27 am, nachiket bhagwat \<[nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com) ([http://gmail.com](http://gmail.com))\>  
> > > wrote:
> > > 
> > > > In logs I am getting this.
> 
> > > > [2011-07-01 09:54:17,342][INFO][cluster.metadata] [Leash]  
> > > > Updating number\_of\_replicas to [4] for indices [test]  
> > > > [2011-07-01 09:54:49,865][WARN][http.netty] [Leash]  
> > > > Caught exception while handling client http traffic, closing  
> > > > connection  
> > > > java.lang.IllegalStateException: cannot send more responses than  
> > > > requests  
> > > > at  
> > > > org.elasticsearch.common.netty.handler.codec.http.HttpContentEncoder.writeRequested(HttpContentEncoder.java:  
> > > > 102)  
> > > > at  
> > > > org.elasticsearch.common.netty.channel.SimpleChannelHandler.handleDownstream(SimpleChannelHandler.java:  
> > > > 266)  
> > > > at  
> > > > org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:  
> > > > 568)  
> > > > at  
> > > > org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:  
> > > > 563)  
> > > > at  
> > > > org.elasticsearch.common.netty.channel.Channels.write(Channels.java:  
> > > > 611)  
> > > > at  
> > > > org.elasticsearch.common.netty.channel.Channels.write(Channels.java:  
> > > > 578)  
> > > > at  
> > > > org.elasticsearch.common.netty.channel.AbstractChannel.write(AbstractChannel.java:  
> > > > 259)  
> > > > at  
> > > > org.elasticsearch.http.netty.NettyHttpChannel.sendResponse(NettyHttpChannel.java:  
> > > > 144)  
> > > > at  
> > > > org.elasticsearch.rest.action.admin.indices.settings.RestUpdateSettingsAction  
> > > > $1.onResponse(RestUpdateSettingsAction.java:81)  
> > > > at  
> > > > org.elasticsearch.rest.action.admin.indices.settings.RestUpdateSettingsAction  
> > > > $1.onResponse(RestUpdateSettingsAction.java:74)  
> > > > at org.elasticsearch.action.support.BaseAction$ThreadedActionListener  
> > > > $1.run(BaseAction.java:84)  
> > > > at  
> > > > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:  
> > > > 1110)  
> > > > at java.util.concurrent.ThreadPoolExecutor  
> > > > $Worker.run(ThreadPoolExecutor.java:603)  
> > > > at java.lang.Thread.run(Thread.java:679)
> 
> > > > On Jul 1, 10:08 am, nachiket bhagwat \<[nachiketbhag...@gmail.com](mailto:nachiketbhag...@gmail.com) ([http://gmail.com](http://gmail.com))\>  
> > > > wrote:
> 
> > > > > Hi.  
> > > > > My Elasticsearch was working fine before I tried to configure cache  
> > > > > filter. I tried to do this -\>
> 
> > > > > curl -XPUT localhost:9200/twitter/\_settings -d  
> > > > > {  
> > > > > "index" : {  
> > > > > "number\_of\_replicas" : 4, "type":  
> > > > > "node" ,"index.cache.filter.max\_size" : "20%" ,  
> > > > > "index\_cache\_field\_expiry" : "5m"  
> > > > > }
> 
> > > > > }
> 
> > > > > And now I am unable to run evan a simple query. I get the message -\>  
> > > > > {  
> > > > > "error" : "SearchPhaseExecutionException[Failed to execute phase  
> > > > > [query], total failure; shardFailures {[_na_][twitter][0]: No active  
> > > > > shards}{[_na_][twitter][1]: No active shards}{[_na_][twitter][2]: No  
> > > > > active shards}{[_na_][twitter][3]: No active shards}{[_na_][twitter]  
> > > > > [4]: No active shards}]",  
> > > > > "status" : 500
> 
> > > > > }
> 
> > > > > Can somebody please help to understand what I did and how to fix it?
> 
> > > > > Regards.

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [July 1, 2011, 12:55pm UTC](https://discuss.elastic.co/t/error-while-caching/4748/8 "2011-07-01T12:55:26Z")

</div>

On Fri, 2011-07-01 at 05:37 -0700, nachiket bhagwat wrote:

> When I am doing for new index  
> curl -XPUT localhost:9200/twitter2 -d '{  
> "settings" : {  
> "index" : {  
> "number\_of\_shards" : 1,  
> "number\_of\_replicas" : "4"  
> }  
> }  
> }'  
> It is correctly indexing and searching.
> 
> But when I do it for existing index  
> curl -XPUT localhost:9200/twitter -d '{  
> "settings" : {  
> "index" : {  
> "number\_of\_shards" : 1,  
> "number\_of\_replicas" : "4"  
> }  
> }  
> }'  
> It is giving  
> {"error":"IndexAlreadyExistsException[[twitter] Already  
> exists]","status":400}. How can I configure my index??

You need to delete the index and create a new one.

You can use index aliases to make this transparent to your main  
application (ie the main app uses an alias which points to the current  
index, then you can change the real index in the background, and just  
update the alias)

clint

---

<div class="post-metadata">

**Author:** ![nachiket](https://avatars.discourse-cdn.com/v4/letter/n/4491bb/32.png) [@nachiket](https://discuss.elastic.co/u/nachiket)\
**Post date:** [July 1, 2011, 1:17pm UTC](https://discuss.elastic.co/t/error-while-caching/4748/9 "2011-07-01T13:17:48Z")

</div>

Hi. I made an alias for my index and changed name of index to wherever  
I wrote twitter.  
Then I deleted my twitter index to put setting  
curl -XPUT localhost:9200/twitter -d '{  
"settings" : {  
"index" : {  
"number\_of\_shards" : 1,  
"number\_of\_replicas" : "4"  
}  
}  
}'

But my data was lost as soon as I deleted the main twitter index.  
Though it was not a big loss for now for future references can you  
elaborate on how to do following:  
(the main application uses an alias which points to the current  
index, then you can change the real index in the background, and just  
update the alias)

On Jul 1, 5:55 pm, Clinton Gormley [clin...@iannounce.co.uk](mailto:clin...@iannounce.co.uk) wrote:

> On Fri, 2011-07-01 at 05:37 -0700, nachiket bhagwat wrote:
> 
> > When I am doing for new index  
> > curl -XPUT localhost:9200/twitter2 -d '{  
> > "settings" : {  
> > "index" : {  
> > "number\_of\_shards" : 1,  
> > "number\_of\_replicas" : "4"  
> > }  
> > }  
> > }'  
> > It is correctly indexing and searching.
> 
> > But when I do it for existing index  
> > curl -XPUT localhost:9200/twitter -d '{  
> > "settings" : {  
> > "index" : {  
> > "number\_of\_shards" : 1,  
> > "number\_of\_replicas" : "4"  
> > }  
> > }  
> > }'  
> > It is giving  
> > {"error":"IndexAlreadyExistsException[[twitter] Already  
> > exists]","status":400}. How can I configure my index??
> 
> You need to delete the index and create a new one.
> 
> You can use index aliases to make this transparent to your main  
> application (ie the main app uses an alias which points to the current  
> index, then you can change the real index in the background, and just  
> update the alias)
> 
> clint

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [July 1, 2011, 1:26pm UTC](https://discuss.elastic.co/t/error-while-caching/4748/10 "2011-07-01T13:26:47Z")

</div>

> But my data was lost as soon as I deleted the main twitter index.  
> Though it was not a big loss for now for future references can you  
> elaborate on how to do following:  
> (the main application uses an alias which points to the current  
> index, then you can change the real index in the background, and just  
> update the alias)

- create index twitter\_20110701
- create alias 'twitter' which points to twitter\_20110701
- your app uses the index 'twitter'

now you need to change the mapping

- create index twitter\_20110702
- reindex your data from twitter\_20110701 to twitter\_20110702
- update alias 'twitter' to point to twitter\_20110702
- delete index twitter\_20110701

Alternatively, if your old data doesn't need to be reindexed with the  
new mapping, you can have two aliases:

- twitter\_write (points to current index)
- twitter\_read (points to current index and older indices)

clint

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [July 2, 2011, 9:26am UTC](https://discuss.elastic.co/t/error-while-caching/4748/11 "2011-07-02T09:26:01Z")

</div>

On Fri, 2011-07-01 at 04:07 -0700, nachiket wrote:

> Thanks a lot.  
> I have just started looking into how to index and search with Elastic  
> Search.  
> But I couldn't find how to configure the index. I used one code from one of  
> the replies on another topic.  
> Can you tell me where to find it out?

The docs could be better than they are, but all of the information is  
available from here: [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/)

clint

---

<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 6, 2017, 4:02am UTC](https://discuss.elastic.co/t/error-while-caching/4748/12 "2017-07-06T04:02:03Z")

</div>


