skip to Main Content

WINDOWS 10 — SOLR 7.5.0 — JDK 11.0.1 — JRE1.8.0_191 — SIMPLEPOSTTOOL 5.0.0

I HAVE POSTED THE SOLUTION BELOW; USER: FamousAv8er

I am trying to follow this tutorial to understand more about Solr. Unfortunately I cannot seem to understand how I need to structure my statement to make the POST successful.
I have tried multiple commands to try and Post, here are a few

C:Program FilesSolrsolr-7.5.0example>java -jar post.jar films.xml
Error: Unable to access jarfile post.jar

C:Program FilesSolrsolr-7.5.0example>java -jar /exampledocs/post.jar /films/films.xml
Error: Unable to access jarfile /exampledocs/post.jar

C:Program FilesSolrsolr-7.5.0example>java -jar exampledocs/post.jar films/films.xml
SimplePostTool version 5.0.0
SimplePostTool: FATAL: Specifying either url or core/collection is mandatory.
Usage: java [SystemProperties] -jar post.jar [-h|-] [<file|folder|url|arg> [<file|folder|url|arg>...]]

How should I structure this command to get a successful Post?
I have also tried editing permissions and unblocking the associated files.

4

Answers


  1. Chosen as BEST ANSWER

    Here is the final solution to my issue using the SimplePostTool:

    TO BE NOTED FOR OTHERS:

    • Run this command from C:Program FilesSolrsolr-7.5.0example so that the pathways to the files can be done more easily. Also the system doesnt seem to recognize a full pathway.
    • Check permissions and that all files accessed are unblocked.
    • Use the following syntax:

    java -Dc=YourCoreName -jar exampledocs/post.jar films/films.xml

    C:Program FilesSolrsolr-7.5.0example>java -Dc=films -jar exampledocs/post.jar films/films.xml
    SimplePostTool version 5.0.0
    Posting files to [base] url http://localhost:8983/solr/films/update using content-type application/xml...
    POSTing file films.xml to [base]
    1 files indexed.
    COMMITting Solr index changes to http://localhost:8983/solr/films/update...
    Time spent: 0:00:02.392
    

  2. You can get the syntax for the post.jar by running it as follow:

    cd C:Program FilesSolrsolr-7.5.0exampleexampledocs
    java -jar post.jar -h

    I believe you need to pass the name of the Solr core that you want to update, something along these lines:

    cd C:Program FilesSolrsolr-7.5.0exampleexampledocs
    java -Dc=name-of-your-core -jar post.jar c:/full/path/to/films.xml

    I seem to remember that on Windows I had to copy the file to import (films.xml in your case) to the same folder where the post.jar file is located (C:Program FilesSolrsolr-7.5.0exampleexampledocs in your case) but I am not sure about that.

    Login or Signup to reply.
  3. java -Dc=gettingstarted -jar exampleexampledocspost.jar exampleexampledocs*.xml
    

    Run this command inside solr folder. It gave the following output.

    C:optsolr-5.2.1>java -Dc=gettingstarted -jar exampleexampledocspost.jar exampleexampledocs*.xml
    SimplePostTool version 5.0.0
    Posting files to [base] url http://localhost:8983/solr/gettingstarted/update using content-type application/xml...
    POSTing file gb18030-example.xml to [base]
    POSTing file hd.xml to [base]
    POSTing file ipod_other.xml to [base]
    POSTing file ipod_video.xml to [base]
    POSTing file manufacturers.xml to [base]
    POSTing file mem.xml to [base]
    POSTing file money.xml to [base]
    POSTing file monitor.xml to [base]
    POSTing file monitor2.xml to [base]
    POSTing file mp500.xml to [base]
    POSTing file sd500.xml to [base]
    POSTing file solr.xml to [base]
    POSTing file utf8-example.xml to [base]
    POSTing file vidcard.xml to [base]
    14 files indexed.
    COMMITting Solr index changes to http://localhost:8983/solr/gettingstarted/update...
    Time spent: 0:00:22.043
    
    Login or Signup to reply.
  4. Sometimes there is an issue reading the path of the post.jar file.

    In the tutorial it says the command is: java -jar /exampledocs/post.jar /films/films.xml

    Instead give the full path:
    java -jar C:Program Filessolr-8.6.1examplefilmspost.jar films.xml

    This worked for me

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search