1. Download solr
Download: http://archive.apache.org/dist/lucene/solr/
The address can also download the previous version, I downloaded solr-8.0.0.zip version here. After the download is complete on the D: \ directory under the project, and then extract to the current directory.
2, startup, shutdown solr
Navigate to the bin folder solr directory after decompression, after which go right into the Powershell enter the following command:
3. Create core
In solr directory \ server \ solr core folder, create a folder on my side folder name is called xjxcc. Then \ server \ solr \ configsets \ sample_techproducts_configs following conf folder to the core file you just created folder below.
Solr start after completion of the above operation, after a successful start to open the browser to access http://127.0.0.1:8983/solr/#/ address, you can see solr management interface. Click on the left of the Core Admin, the new page name and instanceDir input box were changed to core file you just created folder name (I am here is xjxcc), then click on Add Core button below to successfully create core (originally cut a Figure Zhang operation, the result CSDN upload Bild unknown error).
After creating a successful, will generate a file folder and a core file you just created folder below, this means that create success.
4, create springboot project and test code
How to create a project springboot not say, paste the following key documents:
Then after the start of the project, to enter http: // localhost: 9633 / swagger -ui.html address to test insertion index operations. After successful insertion, in the lower left solr management interface has a drop-down box, select the core you created after, and then select Query, and finally dragged down, click Execute Query to see you just insert the index.
other problems:
We have just embed the two columns (id, name), if you want to add a column, such as name, called zhangsan, and then start the project, inserted in the index, you can not see in solr management platform in the column names and corresponding value, because the id, name two columns already in the default configuration in solr. This situation resolved as follows:
In the core files you create the following folder, open the conf folder, modify the inside of the managed-schema file, modify the following locations:
Solr restart after changes are complete, and then reinsert the index can be successfully operated.