Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0
    • Fix Version/s: 5.5, 6.0
    • Component/s: scripts and tools
    • Labels:
      None

      Description

      The current (5.0) version of bin/post assumes JSON (and XML) are in Solr command format, eg. bin/post -c collection1 data.json and that the URL to post to is /update.

      This issue is to improve/evolve bin/post so that it can post to /update when the data is in Solr XML or JSON format and to /update/json/docs for arbitrary JSON.

      1. SOLR-7042.patch
        5 kB
        Shalin Shekhar Mangar

        Activity

        Hide
        Erik Hatcher added a comment -

        It is possible to post to /update/json/docs currently with:

        $ bin/post -url http://localhost:8983/solr/collection1/update/json/docs -c collection1 data.json
        

        and then using -params to add mappings, etc. But this should be streamlined, for one not having to specify -url.

        One suggestion is to reverse the assumption, and assume JSON (and eventually XML) is arbitrary, non-Solr-specific format, and make it explicit when the data is in Solr format, such as:

        $ bin/post -c collection1 data.json  # assumes arbitrary JSON, posts to /update/json/docs
        $ bin/post -c collection1 example/films/films.json -format solr # posts to /update
        
        Show
        Erik Hatcher added a comment - It is possible to post to /update/json/docs currently with: $ bin/post -url http: //localhost:8983/solr/collection1/update/json/docs -c collection1 data.json and then using -params to add mappings, etc. But this should be streamlined, for one not having to specify -url . One suggestion is to reverse the assumption, and assume JSON (and eventually XML) is arbitrary, non-Solr-specific format, and make it explicit when the data is in Solr format, such as: $ bin/post -c collection1 data.json # assumes arbitrary JSON, posts to /update/json/docs $ bin/post -c collection1 example/films/films.json -format solr # posts to /update
        Hide
        Shalin Shekhar Mangar added a comment -

        Bulk move to 5.4 after 5.3 release.

        Show
        Shalin Shekhar Mangar added a comment - Bulk move to 5.4 after 5.3 release.
        Hide
        Shalin Shekhar Mangar added a comment -

        Patch which adds support for jsonl files. See http://jsonlines.org/

        Now json and jsonl files are by default sent to /update/json/docs. In case someone has files in the solr json format then they can use -format solr to force the update to be sent to /update.

        Show
        Shalin Shekhar Mangar added a comment - Patch which adds support for jsonl files. See http://jsonlines.org/ Now json and jsonl files are by default sent to /update/json/docs. In case someone has files in the solr json format then they can use -format solr to force the update to be sent to /update.
        Hide
        ASF subversion and git services added a comment -

        Commit 1723879 from Erik Hatcher in branch 'dev/trunk'
        [ https://svn.apache.org/r1723879 ]

        SOLR-7042: bin/post defaults application/json to /update/json/docs now

        Show
        ASF subversion and git services added a comment - Commit 1723879 from Erik Hatcher in branch 'dev/trunk' [ https://svn.apache.org/r1723879 ] SOLR-7042 : bin/post defaults application/json to /update/json/docs now
        Hide
        ASF subversion and git services added a comment -

        Commit 1723880 from Erik Hatcher in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1723880 ]

        SOLR-7042: bin/post defaults application/json to /update/json/docs now (merged from trunk r1723879)

        Show
        ASF subversion and git services added a comment - Commit 1723880 from Erik Hatcher in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1723880 ] SOLR-7042 : bin/post defaults application/json to /update/json/docs now (merged from trunk r1723879)
        Hide
        Erik Hatcher added a comment -

        Thanks Shalin Shekhar Mangar! I committed with a couple of minor changes: added jsonl to the list in SPT and added example/exampledocs/more_books.jsonl to allow easy demonstration of jsonl in action.

        Show
        Erik Hatcher added a comment - Thanks Shalin Shekhar Mangar ! I committed with a couple of minor changes: added jsonl to the list in SPT and added example/exampledocs/more_books.jsonl to allow easy demonstration of jsonl in action.

          People

          • Assignee:
            Erik Hatcher
            Reporter:
            Erik Hatcher
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development