# Elasticsearch broken

**URL:** <https://discuss.elastic.co/t/elasticsearch-broken/22281>\
**Category:** Elasticsearch\
**Created:** [February 20, 2015, 1:16am UTC](https://discuss.elastic.co/t/elasticsearch-broken/22281 "2015-02-20T01:16:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![storyteller](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/storyteller/32/891_2.png) [@storyteller](https://discuss.elastic.co/u/storyteller)\
**Post date:** [February 20, 2015, 1:16am UTC](https://discuss.elastic.co/t/elasticsearch-broken/22281/1 "2015-02-20T01:16:34Z")

</div>

Hello,

I recently started attempting to use elasticsearch to store some data.  
In the learning process, I was doing ok until I attempted using the bulk api.  
I used the something along the lines of:

conn = ES(url, timeout, bulksize)

for each (tuple)  
data = something(tuple)  
conn.index(data, index name, count, bulk=true)

Which I imagined would add a large number of items to localhost:9200/(index name)/(type name)/(count), but it ended up adding a large number of garbage at localhost:9200/(index name).  
Not sure how to proceed, but knowing that I needed a reset, I went ahead and did a delete on localhost:9200/\*, which deleted everything as expected. I thus attempted to begin again, with adding a index with mapping.

curl -XPUT "[http://localhost:9200/](http://localhost:9200/)(index name)" -d mapping.json

mapping.json:  
{  
"settings": {  
"analysis": {  
"analyzer": {  
"ngram\_analyzer": {  
"tokenizer": "ngram\_tokenizer"  
}  
},  
"tokenizer": {  
"ngram\_tokenizer": {  
"type": "nGram",  
"min\_gram": "2",  
"max\_gram": "3",  
"token\_chars": [  
"letter",  
"digit",  
"symbol",  
"punctuation",  
"whitespace"  
]  
}  
}  
}  
},  
"mappings": {  
"access": {  
"properties": {  
"date": {  
"type": "date",  
"format": "YYYY-MM-dd",  
"analyzer": "ngram\_analyzer"  
},  
"time": {  
"type": "date",  
"format": "HH:mm:ss",  
"analyzer": "ngram\_analyzer"  
},  
"protocol": {  
"type": "string",  
"analyzer": "ngram\_analyzer"  
},  
"source ip": {  
"type": "string",  
"analyzer": "ngram\_analyzer"  
},  
"source port": {  
"type": "integer"  
},  
"country": {  
"type": "string",  
"analyzer": "ngram\_analyzer"  
},  
"organization": {  
"type": "string",  
"analyzer": "ngram\_analyzer"  
},  
"dest ip": {  
"type": "string",  
"analyzer": "ngram\_analyzer"  
},  
"dest port": {  
"type": "integer"  
}  
}  
}  
}  
}

This is where the troubles began. While the above command created a node at (index name), it refused to populate the index with my settings.

{  
"darknet" : {  
"aliases" : { },  
"mappings" : { },  
"settings" : {  
"index" : {  
"creation\_date" : "1424425712525",  
"mapping" : {  
"json" : ""  
},  
"uuid" : "cgTEPkqnQJKejLPyHqVNYA",  
"number\_of\_replicas" : "1",  
"number\_of\_shards" : "5",  
"version" : {  
"created" : "1040399"  
}  
}  
},  
"warmers" : { }  
}  
}

I attempted to update the node with curl -XPUT "[http://localhost:9200/](http://localhost:9200/)(index name)/\_setting" -d mapping.json after a close, but that also left the index blank.  
I delete the index, create another index, etc. etc. but to no avail.

In the end, I manage to make a change to the index, though not a good one.  
I made a call to the update mapping API, which changed the index into a horrifying monstrosity with repeating tags, like so:

{  
"darknet" : {  
"aliases" : { },  
"mappings" : {  
"1" : {  
"properties" : {  
"mappings" : {  
"properties" : {  
"access" : {  
"properties" : {  
"properties" : {  
"properties" : {  
"country" : {  
"properties" : {  
"analyzer" : {  
"type" : "string"  
},  
"type" : {  
"type" : "string"  
}  
}  
},  
"date" : {  
"properties" : {  
"analyzer" : {  
"type" : "string"  
},  
"format" : {  
"type" : "string"  
},  
"type" : {  
"type" : "string"  
}  
}  
},  
"dest ip" : {  
"properties" : {  
"analyzer" : {  
"type" : "string"  
},  
"type" : {  
"type" : "string"  
}  
}  
},  
"dest port" : {  
"properties" : {  
"type" : {  
"type" : "string"  
}  
}  
},  
"organization" : {  
"properties" : {  
"analyzer" : {  
"type" : "string"  
},  
"type" : {  
"type" : "string"  
}  
}  
},  
"protocol" : {  
"properties" : {  
"analyzer" : {  
"type" : "string"  
},  
"type" : {  
"type" : "string"  
}  
}  
},  
"source ip" : {  
"properties" : {  
"analyzer" : {  
"type" : "string"  
},  
"type" : {  
"type" : "string"  
}  
}  
},  
"source port" : {  
"properties" : {  
"type" : {  
"type" : "string"  
}  
}  
},  
"time" : {  
"properties" : {  
"analyzer" : {  
"type" : "string"  
},  
"format" : {  
"type" : "string"  
},  
"type" : {  
"type" : "string"  
}  
}  
}  
}  
}  
}  
}  
}  
},  
"settings" : {  
"properties" : {  
"analysis" : {  
"properties" : {  
"analyzer" : {  
"properties" : {  
"ngram\_analyzer" : {  
"properties" : {  
"tokenizer" : {  
"type" : "string"  
}  
}  
}  
}  
},  
"tokenizer" : {  
"properties" : {  
"ngram\_tokenizer" : {  
"properties" : {  
"max\_gram" : {  
"type" : "string"  
},  
"min\_gram" : {  
"type" : "string"  
},  
"token\_chars" : {  
"type" : "string"  
},  
"type" : {  
"type" : "string"  
}  
}  
}  
}  
}  
}  
}  
}  
}  
}  
}  
},  
"settings" : {  
"index" : {  
"creation\_date" : "1424363851475",  
"uuid" : "TNBwPJxURz2kwA-bQJklIQ",  
"number\_of\_replicas" : "1",  
"number\_of\_shards" : "5",  
"version" : {  
"created" : "1040399"  
}  
}  
},  
"warmers" : { }  
}  
}

I'm guessing I broke something in the process of bulk indexing and subsequent mass deletion.  
I'm currently looking for a way to either fix this, or reset elasticsearch on my machine to "factory state". I would much appreciate it if you could give me a hand with this.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:31am UTC](https://discuss.elastic.co/t/elasticsearch-broken/22281/2 "2017-07-06T00:31:21Z")

</div>


