I failed to create my ElasticSearch index, again. Here are my steps:
- created index with name clef2018, number of shard=1, number of replicas=0
- closed index
- put settings of clef2018 (website)
- put mappings of clef2018 (website)
- opened index
- checked that no document indexed
- cannot added document with bulk API or python
- also search failed
Is it an ElasticSearch issue? My python script is:
from elasticsearch import Elasticsearch
title="title"
body="body"
es = Elasticsearch([{"host": "10.0.0.1", "port": 9200}])
contentt = {'content': title +"\n"+ body}
res = ""
idd=idd+1
try:
res = es.index(index='clef2018', doc_type='_doc', id=idd, body=contentt)
except:
print("error:" + str(res))
Error is:
{
"error": {
"root_cause": [
{
"type": "unavailable_shards_exception",
"reason": "[example][0] primary shard is not active Timeout: [1m], request: [BulkShardRequest [[example][0]] containing [index {[example][_doc][1], source[{\n \"content\": \"Hello world\"\n}]}]]"
}
],
"type": "unavailable_shards_exception",
"reason": "[example][0] primary shard is not active Timeout: [1m], request: [BulkShardRequest [[example][0]] containing [index {[example][_doc][1], source[{\n \"content\": \"Hello world\"\n}]}]]"
},
"status": 503
}