Expected: OBJECT_START but got ARRAY_START at [16]











up vote
3
down vote

favorite












How to add multiple JSON documents through the Solr Admin Documents page?



I tried with json:



[ 
{
"id" : "001",
"name" : "Ram",
"age" : 53,
"Designation" : "Manager",
"Location" : "Hyderabad",
},
{
"id" : "002",
"name" : "Robert",
"age" : 43,
"Designation" : "SR.Programmer",
"Location" : "Chennai",
},
{
"id" : "003",
"name" : "Rahim",
"age" : 25,
"Designation" : "JR.Programmer",
"Location" : "Delhi",
}
]


After click Submit Document, it returns errors:




Status: error
Error: Bad Request
"msg": "Expected: OBJECT_START but got ARRAY_START at [16]",
"code": 400











share|improve this question




























    up vote
    3
    down vote

    favorite












    How to add multiple JSON documents through the Solr Admin Documents page?



    I tried with json:



    [ 
    {
    "id" : "001",
    "name" : "Ram",
    "age" : 53,
    "Designation" : "Manager",
    "Location" : "Hyderabad",
    },
    {
    "id" : "002",
    "name" : "Robert",
    "age" : 43,
    "Designation" : "SR.Programmer",
    "Location" : "Chennai",
    },
    {
    "id" : "003",
    "name" : "Rahim",
    "age" : 25,
    "Designation" : "JR.Programmer",
    "Location" : "Delhi",
    }
    ]


    After click Submit Document, it returns errors:




    Status: error
    Error: Bad Request
    "msg": "Expected: OBJECT_START but got ARRAY_START at [16]",
    "code": 400











    share|improve this question


























      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      How to add multiple JSON documents through the Solr Admin Documents page?



      I tried with json:



      [ 
      {
      "id" : "001",
      "name" : "Ram",
      "age" : 53,
      "Designation" : "Manager",
      "Location" : "Hyderabad",
      },
      {
      "id" : "002",
      "name" : "Robert",
      "age" : 43,
      "Designation" : "SR.Programmer",
      "Location" : "Chennai",
      },
      {
      "id" : "003",
      "name" : "Rahim",
      "age" : 25,
      "Designation" : "JR.Programmer",
      "Location" : "Delhi",
      }
      ]


      After click Submit Document, it returns errors:




      Status: error
      Error: Bad Request
      "msg": "Expected: OBJECT_START but got ARRAY_START at [16]",
      "code": 400











      share|improve this question















      How to add multiple JSON documents through the Solr Admin Documents page?



      I tried with json:



      [ 
      {
      "id" : "001",
      "name" : "Ram",
      "age" : 53,
      "Designation" : "Manager",
      "Location" : "Hyderabad",
      },
      {
      "id" : "002",
      "name" : "Robert",
      "age" : 43,
      "Designation" : "SR.Programmer",
      "Location" : "Chennai",
      },
      {
      "id" : "003",
      "name" : "Rahim",
      "age" : 25,
      "Designation" : "JR.Programmer",
      "Location" : "Delhi",
      }
      ]


      After click Submit Document, it returns errors:




      Status: error
      Error: Bad Request
      "msg": "Expected: OBJECT_START but got ARRAY_START at [16]",
      "code": 400








      json ubuntu solr






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 4 '17 at 6:03









      Toywo

      2,209101824




      2,209101824










      asked Apr 4 '17 at 3:27









      Ken Nguyen

      90110




      90110
























          4 Answers
          4






          active

          oldest

          votes

















          up vote
          2
          down vote













          Remove the [ ] bracket, this works for me.



          { 
          "id" : "001",
          "name" : "Ram",
          "age" : 53,
          "Designation" : "Manager",
          "Location" : "Hyderabad"
          },
          {
          "id" : "002",
          "name" : "Robert",
          "age" : 43,
          "Designation" : "SR.Programmer",
          "Location" : "Chennai"
          },
          {
          "id" : "003",
          "name" : "Rahim",
          "age" : 25,
          "Designation" : "JR.Programmer",
          "Location" : "Delhi"
          }





          share|improve this answer






























            up vote
            0
            down vote













            Try to remove , before } symbol like follows



            [ 
            {
            "id" : "001",
            "name" : "Ram",
            "age" : 53,
            "Designation" : "Manager",
            "Location" : "Hyderabad"
            },
            {
            "id" : "002",
            "name" : "Robert",
            "age" : 43,
            "Designation" : "SR.Programmer",
            "Location" : "Chennai"
            },
            {
            "id" : "003",
            "name" : "Rahim",
            "age" : 25,
            "Designation" : "JR.Programmer",
            "Location" : "Delhi"
            }
            ]


            You can check json format in this link also https://jsonformatter.curiousconcept.com/






            share|improve this answer





















            • I just try and it still returns same errors Bad Request with msg: Expected: OBJECT_START but got ARRAY_START at [16]
              – Ken Nguyen
              Apr 4 '17 at 3:51










            • try to use { instead of [ and } instead of ]
              – selvarajmas
              Apr 4 '17 at 4:03










            • It we use { instead of [ and } instead of ] It returns JSON Parse Error. Btw, I still post above json through terminal by syntax ./post -c name_core file_include_json_content.json
              – Ken Nguyen
              Apr 4 '17 at 4:52




















            up vote
            0
            down vote













            Just remove the square braces and , at the end from Hyderabad, Chennai and Delhi.
            It will work






            share|improve this answer




























              up vote
              0
              down vote













              select "JSON" from the pulldown... this accepts only a single JSON document to be added, because it wraps it in tags like so...



              {
              "add": {
              "doc": YOUR_TEXT_AREA_INPUT,
              "boost": BOOST_FORM_INPUT,
              "overwrite": CHECKBOX_INPUT,
              "commitWithin": COMMIT_WITHIN_FORM_INPUT
              }
              }


              You should be choose "Solr Command (raw XML or JSON)",like this:



              {
              "add":{
              "doc":{
              "product_catalog_name": "123",
              "product_price": 80,
              "product_name": "a",
              "id": "33998",
              "product_picture": "2014032417271233.png"
              }
              },
              "add":{
              "doc":{
              "product_catalog_name": "123",
              "product_price": 100,
              "product_name": "b",
              "id": "33999",
              "product_picture": "2014032417271233.png"
              }
              }
              }





              share|improve this answer























              • Learn how to use code block
                – 蕭為元
                Nov 11 at 2:33











              Your Answer






              StackExchange.ifUsing("editor", function () {
              StackExchange.using("externalEditor", function () {
              StackExchange.using("snippets", function () {
              StackExchange.snippets.init();
              });
              });
              }, "code-snippets");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "1"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f43197708%2fexpected-object-start-but-got-array-start-at-16%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              4 Answers
              4






              active

              oldest

              votes








              4 Answers
              4






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              2
              down vote













              Remove the [ ] bracket, this works for me.



              { 
              "id" : "001",
              "name" : "Ram",
              "age" : 53,
              "Designation" : "Manager",
              "Location" : "Hyderabad"
              },
              {
              "id" : "002",
              "name" : "Robert",
              "age" : 43,
              "Designation" : "SR.Programmer",
              "Location" : "Chennai"
              },
              {
              "id" : "003",
              "name" : "Rahim",
              "age" : 25,
              "Designation" : "JR.Programmer",
              "Location" : "Delhi"
              }





              share|improve this answer



























                up vote
                2
                down vote













                Remove the [ ] bracket, this works for me.



                { 
                "id" : "001",
                "name" : "Ram",
                "age" : 53,
                "Designation" : "Manager",
                "Location" : "Hyderabad"
                },
                {
                "id" : "002",
                "name" : "Robert",
                "age" : 43,
                "Designation" : "SR.Programmer",
                "Location" : "Chennai"
                },
                {
                "id" : "003",
                "name" : "Rahim",
                "age" : 25,
                "Designation" : "JR.Programmer",
                "Location" : "Delhi"
                }





                share|improve this answer

























                  up vote
                  2
                  down vote










                  up vote
                  2
                  down vote









                  Remove the [ ] bracket, this works for me.



                  { 
                  "id" : "001",
                  "name" : "Ram",
                  "age" : 53,
                  "Designation" : "Manager",
                  "Location" : "Hyderabad"
                  },
                  {
                  "id" : "002",
                  "name" : "Robert",
                  "age" : 43,
                  "Designation" : "SR.Programmer",
                  "Location" : "Chennai"
                  },
                  {
                  "id" : "003",
                  "name" : "Rahim",
                  "age" : 25,
                  "Designation" : "JR.Programmer",
                  "Location" : "Delhi"
                  }





                  share|improve this answer














                  Remove the [ ] bracket, this works for me.



                  { 
                  "id" : "001",
                  "name" : "Ram",
                  "age" : 53,
                  "Designation" : "Manager",
                  "Location" : "Hyderabad"
                  },
                  {
                  "id" : "002",
                  "name" : "Robert",
                  "age" : 43,
                  "Designation" : "SR.Programmer",
                  "Location" : "Chennai"
                  },
                  {
                  "id" : "003",
                  "name" : "Rahim",
                  "age" : 25,
                  "Designation" : "JR.Programmer",
                  "Location" : "Delhi"
                  }






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Apr 8 '17 at 1:53









                  orvi

                  1,59311227




                  1,59311227










                  answered Apr 7 '17 at 17:42









                  Harmohan Sharma

                  211




                  211
























                      up vote
                      0
                      down vote













                      Try to remove , before } symbol like follows



                      [ 
                      {
                      "id" : "001",
                      "name" : "Ram",
                      "age" : 53,
                      "Designation" : "Manager",
                      "Location" : "Hyderabad"
                      },
                      {
                      "id" : "002",
                      "name" : "Robert",
                      "age" : 43,
                      "Designation" : "SR.Programmer",
                      "Location" : "Chennai"
                      },
                      {
                      "id" : "003",
                      "name" : "Rahim",
                      "age" : 25,
                      "Designation" : "JR.Programmer",
                      "Location" : "Delhi"
                      }
                      ]


                      You can check json format in this link also https://jsonformatter.curiousconcept.com/






                      share|improve this answer





















                      • I just try and it still returns same errors Bad Request with msg: Expected: OBJECT_START but got ARRAY_START at [16]
                        – Ken Nguyen
                        Apr 4 '17 at 3:51










                      • try to use { instead of [ and } instead of ]
                        – selvarajmas
                        Apr 4 '17 at 4:03










                      • It we use { instead of [ and } instead of ] It returns JSON Parse Error. Btw, I still post above json through terminal by syntax ./post -c name_core file_include_json_content.json
                        – Ken Nguyen
                        Apr 4 '17 at 4:52

















                      up vote
                      0
                      down vote













                      Try to remove , before } symbol like follows



                      [ 
                      {
                      "id" : "001",
                      "name" : "Ram",
                      "age" : 53,
                      "Designation" : "Manager",
                      "Location" : "Hyderabad"
                      },
                      {
                      "id" : "002",
                      "name" : "Robert",
                      "age" : 43,
                      "Designation" : "SR.Programmer",
                      "Location" : "Chennai"
                      },
                      {
                      "id" : "003",
                      "name" : "Rahim",
                      "age" : 25,
                      "Designation" : "JR.Programmer",
                      "Location" : "Delhi"
                      }
                      ]


                      You can check json format in this link also https://jsonformatter.curiousconcept.com/






                      share|improve this answer





















                      • I just try and it still returns same errors Bad Request with msg: Expected: OBJECT_START but got ARRAY_START at [16]
                        – Ken Nguyen
                        Apr 4 '17 at 3:51










                      • try to use { instead of [ and } instead of ]
                        – selvarajmas
                        Apr 4 '17 at 4:03










                      • It we use { instead of [ and } instead of ] It returns JSON Parse Error. Btw, I still post above json through terminal by syntax ./post -c name_core file_include_json_content.json
                        – Ken Nguyen
                        Apr 4 '17 at 4:52















                      up vote
                      0
                      down vote










                      up vote
                      0
                      down vote









                      Try to remove , before } symbol like follows



                      [ 
                      {
                      "id" : "001",
                      "name" : "Ram",
                      "age" : 53,
                      "Designation" : "Manager",
                      "Location" : "Hyderabad"
                      },
                      {
                      "id" : "002",
                      "name" : "Robert",
                      "age" : 43,
                      "Designation" : "SR.Programmer",
                      "Location" : "Chennai"
                      },
                      {
                      "id" : "003",
                      "name" : "Rahim",
                      "age" : 25,
                      "Designation" : "JR.Programmer",
                      "Location" : "Delhi"
                      }
                      ]


                      You can check json format in this link also https://jsonformatter.curiousconcept.com/






                      share|improve this answer












                      Try to remove , before } symbol like follows



                      [ 
                      {
                      "id" : "001",
                      "name" : "Ram",
                      "age" : 53,
                      "Designation" : "Manager",
                      "Location" : "Hyderabad"
                      },
                      {
                      "id" : "002",
                      "name" : "Robert",
                      "age" : 43,
                      "Designation" : "SR.Programmer",
                      "Location" : "Chennai"
                      },
                      {
                      "id" : "003",
                      "name" : "Rahim",
                      "age" : 25,
                      "Designation" : "JR.Programmer",
                      "Location" : "Delhi"
                      }
                      ]


                      You can check json format in this link also https://jsonformatter.curiousconcept.com/







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Apr 4 '17 at 3:32









                      selvarajmas

                      963616




                      963616












                      • I just try and it still returns same errors Bad Request with msg: Expected: OBJECT_START but got ARRAY_START at [16]
                        – Ken Nguyen
                        Apr 4 '17 at 3:51










                      • try to use { instead of [ and } instead of ]
                        – selvarajmas
                        Apr 4 '17 at 4:03










                      • It we use { instead of [ and } instead of ] It returns JSON Parse Error. Btw, I still post above json through terminal by syntax ./post -c name_core file_include_json_content.json
                        – Ken Nguyen
                        Apr 4 '17 at 4:52




















                      • I just try and it still returns same errors Bad Request with msg: Expected: OBJECT_START but got ARRAY_START at [16]
                        – Ken Nguyen
                        Apr 4 '17 at 3:51










                      • try to use { instead of [ and } instead of ]
                        – selvarajmas
                        Apr 4 '17 at 4:03










                      • It we use { instead of [ and } instead of ] It returns JSON Parse Error. Btw, I still post above json through terminal by syntax ./post -c name_core file_include_json_content.json
                        – Ken Nguyen
                        Apr 4 '17 at 4:52


















                      I just try and it still returns same errors Bad Request with msg: Expected: OBJECT_START but got ARRAY_START at [16]
                      – Ken Nguyen
                      Apr 4 '17 at 3:51




                      I just try and it still returns same errors Bad Request with msg: Expected: OBJECT_START but got ARRAY_START at [16]
                      – Ken Nguyen
                      Apr 4 '17 at 3:51












                      try to use { instead of [ and } instead of ]
                      – selvarajmas
                      Apr 4 '17 at 4:03




                      try to use { instead of [ and } instead of ]
                      – selvarajmas
                      Apr 4 '17 at 4:03












                      It we use { instead of [ and } instead of ] It returns JSON Parse Error. Btw, I still post above json through terminal by syntax ./post -c name_core file_include_json_content.json
                      – Ken Nguyen
                      Apr 4 '17 at 4:52






                      It we use { instead of [ and } instead of ] It returns JSON Parse Error. Btw, I still post above json through terminal by syntax ./post -c name_core file_include_json_content.json
                      – Ken Nguyen
                      Apr 4 '17 at 4:52












                      up vote
                      0
                      down vote













                      Just remove the square braces and , at the end from Hyderabad, Chennai and Delhi.
                      It will work






                      share|improve this answer

























                        up vote
                        0
                        down vote













                        Just remove the square braces and , at the end from Hyderabad, Chennai and Delhi.
                        It will work






                        share|improve this answer























                          up vote
                          0
                          down vote










                          up vote
                          0
                          down vote









                          Just remove the square braces and , at the end from Hyderabad, Chennai and Delhi.
                          It will work






                          share|improve this answer












                          Just remove the square braces and , at the end from Hyderabad, Chennai and Delhi.
                          It will work







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Jul 27 at 10:23









                          saad

                          276




                          276






















                              up vote
                              0
                              down vote













                              select "JSON" from the pulldown... this accepts only a single JSON document to be added, because it wraps it in tags like so...



                              {
                              "add": {
                              "doc": YOUR_TEXT_AREA_INPUT,
                              "boost": BOOST_FORM_INPUT,
                              "overwrite": CHECKBOX_INPUT,
                              "commitWithin": COMMIT_WITHIN_FORM_INPUT
                              }
                              }


                              You should be choose "Solr Command (raw XML or JSON)",like this:



                              {
                              "add":{
                              "doc":{
                              "product_catalog_name": "123",
                              "product_price": 80,
                              "product_name": "a",
                              "id": "33998",
                              "product_picture": "2014032417271233.png"
                              }
                              },
                              "add":{
                              "doc":{
                              "product_catalog_name": "123",
                              "product_price": 100,
                              "product_name": "b",
                              "id": "33999",
                              "product_picture": "2014032417271233.png"
                              }
                              }
                              }





                              share|improve this answer























                              • Learn how to use code block
                                – 蕭為元
                                Nov 11 at 2:33















                              up vote
                              0
                              down vote













                              select "JSON" from the pulldown... this accepts only a single JSON document to be added, because it wraps it in tags like so...



                              {
                              "add": {
                              "doc": YOUR_TEXT_AREA_INPUT,
                              "boost": BOOST_FORM_INPUT,
                              "overwrite": CHECKBOX_INPUT,
                              "commitWithin": COMMIT_WITHIN_FORM_INPUT
                              }
                              }


                              You should be choose "Solr Command (raw XML or JSON)",like this:



                              {
                              "add":{
                              "doc":{
                              "product_catalog_name": "123",
                              "product_price": 80,
                              "product_name": "a",
                              "id": "33998",
                              "product_picture": "2014032417271233.png"
                              }
                              },
                              "add":{
                              "doc":{
                              "product_catalog_name": "123",
                              "product_price": 100,
                              "product_name": "b",
                              "id": "33999",
                              "product_picture": "2014032417271233.png"
                              }
                              }
                              }





                              share|improve this answer























                              • Learn how to use code block
                                – 蕭為元
                                Nov 11 at 2:33













                              up vote
                              0
                              down vote










                              up vote
                              0
                              down vote









                              select "JSON" from the pulldown... this accepts only a single JSON document to be added, because it wraps it in tags like so...



                              {
                              "add": {
                              "doc": YOUR_TEXT_AREA_INPUT,
                              "boost": BOOST_FORM_INPUT,
                              "overwrite": CHECKBOX_INPUT,
                              "commitWithin": COMMIT_WITHIN_FORM_INPUT
                              }
                              }


                              You should be choose "Solr Command (raw XML or JSON)",like this:



                              {
                              "add":{
                              "doc":{
                              "product_catalog_name": "123",
                              "product_price": 80,
                              "product_name": "a",
                              "id": "33998",
                              "product_picture": "2014032417271233.png"
                              }
                              },
                              "add":{
                              "doc":{
                              "product_catalog_name": "123",
                              "product_price": 100,
                              "product_name": "b",
                              "id": "33999",
                              "product_picture": "2014032417271233.png"
                              }
                              }
                              }





                              share|improve this answer














                              select "JSON" from the pulldown... this accepts only a single JSON document to be added, because it wraps it in tags like so...



                              {
                              "add": {
                              "doc": YOUR_TEXT_AREA_INPUT,
                              "boost": BOOST_FORM_INPUT,
                              "overwrite": CHECKBOX_INPUT,
                              "commitWithin": COMMIT_WITHIN_FORM_INPUT
                              }
                              }


                              You should be choose "Solr Command (raw XML or JSON)",like this:



                              {
                              "add":{
                              "doc":{
                              "product_catalog_name": "123",
                              "product_price": 80,
                              "product_name": "a",
                              "id": "33998",
                              "product_picture": "2014032417271233.png"
                              }
                              },
                              "add":{
                              "doc":{
                              "product_catalog_name": "123",
                              "product_price": 100,
                              "product_name": "b",
                              "id": "33999",
                              "product_picture": "2014032417271233.png"
                              }
                              }
                              }






                              share|improve this answer














                              share|improve this answer



                              share|improve this answer








                              edited Nov 11 at 2:50









                              Stephen Rauch

                              27.4k153156




                              27.4k153156










                              answered Nov 11 at 2:21









                              Y.Hao

                              1




                              1












                              • Learn how to use code block
                                – 蕭為元
                                Nov 11 at 2:33


















                              • Learn how to use code block
                                – 蕭為元
                                Nov 11 at 2:33
















                              Learn how to use code block
                              – 蕭為元
                              Nov 11 at 2:33




                              Learn how to use code block
                              – 蕭為元
                              Nov 11 at 2:33


















                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.





                              Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                              Please pay close attention to the following guidance:


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f43197708%2fexpected-object-start-but-got-array-start-at-16%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Florida Star v. B. J. F.

                              Danny Elfman

                              Lugert, Oklahoma