# Unable to index Html content in Ealsticsearch

**URL:** <https://discuss.elastic.co/t/unable-to-index-html-content-in-ealsticsearch/231154>\
**Category:** Elasticsearch\
**Created:** [May 5, 2020, 12:59pm UTC](https://discuss.elastic.co/t/unable-to-index-html-content-in-ealsticsearch/231154 "2020-05-05T12:59:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sreenath\_Reddy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sreenath_reddy/32/47551_2.png) [@Sreenath\_Reddy](https://discuss.elastic.co/u/Sreenath_Reddy)\
**Post date:** [May 5, 2020, 12:59pm UTC](https://discuss.elastic.co/t/unable-to-index-html-content-in-ealsticsearch/231154/1 "2020-05-05T12:59:28Z")

</div>

Hello all,  
I am trying to index data which is having some html content.  
I tried to use 'html\_strip' but its throwing error.Can you please help me in indexing as I am trying to google things but nothing is helping me.

PUT test  
{  
"settings": {  
"index": {  
"number\_of\_shards": 1,  
"number\_of\_replicas": 0  
},  
"analysis": {  
"analyzer": {  
"ch\_analyzer": {  
"tokenizer": "standard",  
"char\_filter": [  
"html\_strip"  
]  
}  
}  
}  
},  
"mappings": {  
"\_doc": {  
"properties": {  
"content.links": {  
"type": "text",  
"analyzer": "ch\_analyzer"  
}  
}  
}  
}  
}

input:

{"index":{"\_type":"\_doc","\_id":"1486039882869"}}  
{"asset.isflex":"true","page.isbreadcrumbvisible":"true","test.assetid":"Page:1486039882869","asset.type\_description":"Page","page.footer":"Content:1486039854710","asset.type":"Page","page.centralcontent":"Content:1486039859511","record.spec":"Page:1486039882869","asset.subtype":"GenericPageDefinition","page.isleftmenu":"false","page.labelbreadcrumb":"Mobile","Endeca.Action":"UPSERT","asset.type\_name":"Page","page.name":"Business\_main\_mobile","page.header":"Content:1486039843374","asset.id":"1486039882869","asset.type\_subtype":"GenericPageDefinition","asset.type\_plural":"Pages","asset.locale":"en","page.description":"","asset.typename":"Page","page.template":"PageTemplate"}  
{"index":{"\_type":"\_doc","\_id":"1486039861928"}}  
{"asset.isflex":"true","test.assetid":"Content:1486039861928","asset.type\_description":"Content","content.title":"COSMOTEÂ BusinessÂ One","asset.type":"Content","record.spec":"Content:1486039861928","asset.subtype":"Menu\_Content","Endeca.Action":"UPSERT","asset.type\_name":"Content","content.template":"Menu\_Template","content.links":"[Î¦ÏÎ¹Î¬Î¾Îµ ÏÎ¿ ÏÏ?ÏÎ³Ï?Î±Î¼Î¼Î¬ ÏÎ¿Ï](https://www.cosmote.gr/businessone/offercalc/intro)","asset.id":"1486039861928","asset.type\_subtype":"Menu\_Content","asset.type\_plural":"Contents","asset.locale":"gr","asset.typename":"Content","content.description":"","content.name":"Menu\_Content50"}  
{"index":{"\_type":"\_doc","\_id":"1486055804091"}}  
{"asset.isflex":"true","test.assetid":"Content:1486055804091","asset.type\_description":"Content","asset.type":"Content","record.spec":"Content:1486055804091","asset.subtype":"contentFormDef","Endeca.Action":"UPSERT","asset.type\_name":"Content","content.template":"contentMainFormTemplate","content.contentbox":"Content:1486055804389","content.contentfield":"Content:1486055805134","asset.id":"1486055804091","asset.type\_subtype":"contentFormDef","asset.type\_plural":"Contents","asset.locale":"gr","asset.typename":"Content","content.description":"","content.name":"Huawei\_content\_form"}  
{"index":{"\_type":"\_doc","\_id":"1486039835632"}}

Output

[oracle@oel64 input\_data]$ curl -H "Content-Type: application/json" -XPOST "localhost:9200/test/\_bulk?pretty&refresh" --data-binary "@wcssample.json"  
{  
"took" : 84,  
"errors" : true,  
"items" : [  
{  
"index" : {  
"\_index" : "test",  
"\_type" : "\_doc",  
"\_id" : "1486039882869",  
"\_version" : 1,  
"result" : "created",  
"forced\_refresh" : true,  
"\_shards" : {  
"total" : 1,  
"successful" : 1,  
"failed" : 0  
},  
"\_seq\_no" : 0,  
"\_primary\_term" : 1,  
"status" : 201  
}  
},  
{  
"index" : {  
"\_index" : "test",  
"\_type" : "\_doc",  
"\_id" : "1486039861928",  
"status" : 400,  
"error" : {  
"type" : "mapper\_parsing\_exception",  
"reason" : "failed to parse",  
"caused\_by" : {  
"type" : "json\_parse\_exception",  
"reason" : "Unexpected character ('\>' (code 62)): was expecting comma to separate Object entries\n at [Source: org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInputWrapper@1d11e3c1; line: 1, column: 414]"  
}  
}  
}  
},  
{  
"index" : {  
"\_index" : "test",  
"\_type" : "\_doc",  
"\_id" : "1486055804091",  
"\_version" : 1,  
"result" : "created",  
"forced\_refresh" : true,  
"\_shards" : {  
"total" : 1,  
"successful" : 1,  
"failed" : 0  
},  
"\_seq\_no" : 1,  
"\_primary\_term" : 1,  
"status" : 201  
}  
}  
]  
}

---

<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:** [June 2, 2020, 12:59pm UTC](https://discuss.elastic.co/t/unable-to-index-html-content-in-ealsticsearch/231154/2 "2020-06-02T12:59:33Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
