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
Here is the final solution to my issue using the SimplePostTool:
TO BE NOTED FOR OTHERS:
java -Dc=YourCoreName -jar exampledocs/post.jar films/films.xml
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 thepost.jar
file is located (C:Program FilesSolrsolr-7.5.0exampleexampledocs
in your case) but I am not sure about that.Run this command inside solr folder. It gave the following output.
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