• Register
0 votes
698 views

Problem :

I want to send a JSON to elasticSearch. I am trying using Postman and SOAPUI

The data  I am using is as follows:

 

[{"column1": "abc", "column2": "def", "column3": "dghi", "column4": "jkl", "column5": "mno"}, {"column1": "pqr", "column2": "stu", "column3": "vwx", "column4": "", "column5": ""}]

But I am getting the following error :

{

  "error": {

    "root_cause": [

      {

        "type": "mapper_parsing_exception",

        "reason": "failed to parse"

      }

    ],

    "type": "mapper_parsing_exception",

    "reason": "failed to parse",

    "caused_by": {

      "type": "not_x_content_exception",

      "reason": "Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"

    }

  },

  "status": 400

}

But whenever I try to post a single JSON array as follows

 

{"column1": "abc", "column2": "def", "column3": "dghi", "column4": "jkl", "column5": "mno"}

Then it works fine. I am unable to understand that what is going wrong.

6.9k points

1 Answer

0 votes

Solution :

I also had the same error while I was trying to post to elasticsearch but using node js. I utilized the node fetch package to make a PUT request to elasticsearch. It was weird as using the exact same thing on postman there was no error but was having the error on node js. I was initially doing as follows:

 

const current = {

    "id" : "123456789"

}

const options = {

    method: "POST",

    headers: {

        "Content-Type": "application/json"

    },

    body: current

}

And I found that the error got fixed when I changed it as follows:

 

body: JSON.stringify(current)

36.1k points

Related questions

0 votes
2 answers 282 views
282 views
Problem : I am new to Unity5. I am facing following error while trying to do setDestination. "SetDestination" can only be called on an active agent that has been placed on a NavMesh. UnityEngine.NavMeshAgent:SetDestination(Vector3) CompleteProject.EnemyMovement:Update() (at Assets/ ... ; } } } } May I know what is wrong with the above code? Does anyone have any solution on my issue?
asked Nov 27, 2019 alecxe 7.5k points
0 votes
1 answer 37 views
37 views
Problem: What feature on some network switches can be used to detect faked arp messages? A) DHCP snooping B) session monitoring C) dynamic packet inspection D) dynamic ARP inspection Can anyone help who know about network switches?
asked Feb 17 maddi86 5.4k points
0 votes
2 answers 21 views
21 views
Problems: Can anyone give the right solution? The OEM version of Windows 7 can only be installed on a new PC for resale? True or False
asked Feb 13 maddi86 5.4k points
0 votes
1 answer 13 views
13 views
Problem : I want to do below query INSERT INTO dbo.tbl_A_archive ┬áSELECT * FROM SERVERxyz.DB.dbo.tbl_A However even after I ran below code set identity_insert dbo.tbl_A_archive on I am facing below error message “Can only be specified when a column list is used and IDENTITY_INSERT ... a huge number of columns. I can not type all of the columns out manually. How can I get this to be fixed?
asked Jan 29 jwilliam 3.9k points
0 votes
0 answers 1 view
1 view
Problem: Which of the following storage space types can only be created with three or more physical disks? Two-way mirror, striped, simple, three-way mirror, or parity
asked Jul 21 HenryL 620 points