Elasticsearch Insert data under Windows Error!

Source: Internet
Author: User

According to the official documentation, but there are some differences under windows, it does not recognize single quotes ', so if you do this, you will get an error:

C:\users\neusoft>curl LOCALHOST:9200/B1/B2/1-d {"name": "Fdafa"}{"error": "  Mapperparsingexceptionjsonparseexception[Unrecognized token ' Fdafa ': was expecting ' null ', ' true ', ' False '1, column:13]]; "," Status ": 400}

At this point, you need to add double quotes around {}, and double quotes inside the JSON are escaped

C:\users\neusoft>curl LOCALHOST:9200/B1/B2/1-d "{\" name\ ": \" Fdafa\ "}" {"_index": "B1", "_type": "B2", "_id": "1", "_version": 1, "created":True}

This is normal!

 The same problem is encountered under Linux, and sometimes the JSON does not recognize the parameters, and it also needs to be escaped before it can be used.

Elasticsearch Insert data under Windows Error!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.