Now that we've got acquainted with Solr and the various commands involved in Solr's day-to-day usage, let's populate it with data so that we can query it as needed. Solr comes with sample data in examples. We will use the same $solr_home/example/films
for our queries.
Fire up the terminal and create a collection films
with 10
shards:
solr\bin create -c films -shards 10
Now, in $solr_home/example/films
there is file called file.json
. Let's import it into our collection, films
. Based on your OS, hit the appropriate command for the post script or post.jar
.
Uh Oh!! It throws an error, as follows:
What must have gone wrong? By checking the logs while creating the collection, you must have seen a warning.
Note
Warning
Using _default
config set data driven schema functionality is enabled by default, which is not recommended for production use.
To turn it off, use the following command:
curl http://localhost:8983/solr/test11/config -d '{"set-user-property": {"update.autoCreateFields...