Distributed indexing and search
Now that we have SolrCloud up and running, let us see how indexing and search happen in a distributed environment. Go to the <solr_installation>/example/exampledocs
folder where there are some sample XML files. Let us add some documents from the hd.xml
file to SolrCloud. We will use the node solr1
for adding documents to the index. Here we are passing the collection name in the update URL instead of the core. The output from the command execution is shown in the following snippet:
$ java -Durl=http://solr1:8080/solr/mycollection/update -jar post.jar hd.xml SimplePostTool version 1.5 Posting files to base url http://solr1:8080/solr/mycollection/update using content-type application/xml.. POSTing file hd.xml 1 files indexed. COMMITting Solr index changes to http://solr1:8080/solr/mycollection/update.. Time spent: 0:00:21.209
Note
Please use localhost
instead of the solr1
host if running on a local machine.
The documents are now committed into SolrCloud....