Please post the entire error response as well as the version you are using.
Please also format your code/logs/config using the </> button, or markdown style back ticks. It helps to make things easy to read which helps us help you
currently i'm using version 6.5.3 and i found error
C:\Users\Ms>curl -XPUT "localhost:9200/twitter?pretty" -H "Content-Type: application/json" -d '{"settings":{"index":{"number_of_shards":1,"number_of_replicas":2}}}'
{
"error" : {
"root_cause" : [
{
"type" : "not_x_content_exception",
"reason" : "Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"
}
],
"type" : "not_x_content_exception",
"reason" : "Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"
},
"status" : 500
}
Could there be something in the way you've configured or started your Elasticsearch cluster which stops you from creating indices? Could you try to create the index without specifying the settings? E.g. just run:
curl -XPUT 'localhost:9200/twitter'
If this works, it proves you can create indices within your cluster and so there must be something funny going on with the settings.
Thank you sir when i run that command and its give proper output same as yours but when i'm going to adding mapping its give me error can you suggest code to add mapping?
Now that we know you can create indices in the cluster it's time to debug the rest of the command.
Since the entire command works for me I wonder if there is a hidden character in there, causing the trouble? To find out you should try to build up the command from scratch and test each iteration, for instance you could start by just specifying the primary shards (you can add the replicas later):
If this works, then there is something strange with the replica settings.
If it doesn't work, well you can always just rely on the command that worked for creating indices but specify the number of primary and replica shards in a separate Index Template.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.