Spring elastic search


(paul) #1

Hi ,

I am using *spring-elasticsearchhttps://github.com/dadoonet/spring-elasticsearch
*I my configuration is

_settings.json

{
"index" : {
"number_of_shards" : 3,
"number_of_replicas" : 1
}
}

spring.xml

<?xml version="1.0" encoding="UTF-8"?>



<elasticsearch:client id="esClient" esNodes="localhost:9300"
properties="esproperties"
autoscan="false" mappings="twitter/tweet" mergeSettings="true"mergeMapping="true"/>

<util:properties id="esproperties" 

location="classpath:esclient-transport.properties"/>

when i start the esClient 1st time it runs fine when i run the program
again it throws exception as below this happens when i specify
mergeSettings="true"

Exception in thread "main"
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'esClient': Invocation of init method failed; nested
exception is org.elasticsearch.ElasticSearchIllegalArgumentException: can't
change the number of shards for an index

how to avoid this error . when should we use mergeSettings="true"

regards
paul

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(David Pilato) #2

Hmmm…

I think I understand. Factory is first trying to create a new index with your settings (3,1) than after a restart tries to update settings but number of shards is immutable.
Could you open an issue in spring-elasticsearch project?

I would like to find a fix for it.

Thanks

David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 9 oct. 2013 à 14:24, paul avinashpaul85@gmail.com a écrit :

Hi ,

I am using spring-elasticsearch I my configuration is

_settings.json

{
"index" : {
"number_of_shards" : 3,
"number_of_replicas" : 1
}
}

spring.xml

<?xml version="1.0" encoding="UTF-8"?>

<!-- By default, you will get an Elasticsearch Transport Client connected to an Elasticsearch node already running at localhost:9300 using elasticsearch as cluster name -->
<elasticsearch:client id="esClient" esNodes="localhost:9300" properties="esproperties"  
    autoscan="false" mappings="twitter/tweet"  mergeSettings="true" mergeMapping="true"/>

<util:properties id="esproperties" location="classpath:esclient-transport.properties"/>

when i start the esClient 1st time it runs fine when i run the program again it throws exception as below this happens when i specify mergeSettings="true"

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'esClient': Invocation of init method failed; nested exception is org.elasticsearch.ElasticSearchIllegalArgumentException: can't change the number of shards for an index

how to avoid this error . when should we use mergeSettings="true"

regards
paul

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #3