Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-13682

command line option to export data to a file

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 8.3
    • None
    • None

    Description

      example

      bin/solr export -url http://localhost:8983/solr/gettingstarted
      

      This will export all the docs in a collection called gettingstarted into a file called gettingstarted.json

      additional options are

      • format : jsonl (default) or javabin
      • out : export file name 
      • query : a custom query , default is *:*
      • fields: a comma separated list of fields to be exported
      • limit : no:of docs. default is 100 , send  -1 to import all the docs

      Importing using curl

      importing json file

      curl -X POST -d @gettingstarted.json http://localhost:18983/solr/gettingstarted/update/json/docs?commit=true
      

      importing javabin format file

      curl -X POST --header "Content-Type: application/javabin" --data-binary @gettingstarted.javabin http://localhost:7574/solr/gettingstarted/update?commit=true
      

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            noble.paul Noble Paul
            noble.paul Noble Paul
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 20m
                20m

                Slack

                  Issue deployment