Error while caching

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.

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
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.

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*)|(\WOR\W)|(\WAND\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
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
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.

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*)|(\WOR\W)|(\WAND\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 (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 (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.

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?

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 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*)|(\WOR\W)|(\WAND\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 (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 (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.

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 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 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*)|(\WOR\W)|(\WAND\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 (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 (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.

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

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 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

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

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

clint