Inserting data into Solr
Solr provides an easy-to-use command-line tool for sending data in various formats to the Solr server. We can use the post.jar
or post.sh
tool to send data to the Solr server to index data. Both of these tools are located in %SOLR_HOME%/example/exampledocs
in the default installation
folder.
Note
To see the commands for Solr 5.x, visit the Solr Wiki (https://wiki.apache.org/solr/).
We'll copy the two files (post.sh
and post.jar
) to the %SOLR_HOME/bin
folder. The post.sh
is a Unix shell script that wraps around the cURL
command to send data to the Solr server. For Windows users, Solr has provided a standalone Java application packaged in a JAR format. It can be used in a way similar to the post.sh
tool.
To run post.jar
, open Command Prompt in Windows and enter the following:
$ %SOLR_HOME%/bin>java –jar post.jar –h
The result obtained by executing the preceding commands is as follows:
SimplePostTool version 1.5 Usage: java [SystemProperties] -jar...