spring elastic search

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

spring elastic search

paul
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"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:util="http://www.springframework.org/schema/util"
    xmlns:elasticsearch="http://www.pilato.fr/schema/elasticsearch"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
        http://www.pilato.fr/schema/elasticsearch http://www.pilato.fr/schema/elasticsearch/elasticsearch-0.2.xsd">
    <!-- 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"/>
   
</beans>

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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: spring elastic search

dadoonet
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



Le 9 oct. 2013 à 14:24, paul <[hidden email]> 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"?>
    xmlns:elasticsearch="http://www.pilato.fr/schema/elasticsearch"
    <!-- 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"/>
   
</beans>

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 [hidden email].
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.