LIST OF SOLR ADMIN CORE COMMANDS
Posted in SOLR by Arun ChinnachamySOLR Admin Core Commands

SOLR
We have seen configuration of SOLR using schema.xml and How to Search in SOLR using PHPbut it is important to know few URL API commands which let you perform some operations like deleting SOLR index, reloading SOLR or importing data from database to SOLR without restarting the SOLR instance. These SOLR core Admin commands can be used as a reference to administer the SOLR instance. This ranges from reloading SOLR core on Schema.xml changes to refreshing data in SOLR index using DataImportHandler
For this SOLR commands tutorial, we assume that the solr is installed in your local machine and at port 8080. If different, change the url accordingly.
SOLR Core Status
If you want to know the status of multiple cores or status of the instance if no cores, by visiting the below URL from your browser.
http://127.0.0.1:8080/solr/admin/cores?action=STATUS
If you want to know the status of any single core in particular, say core1, visit
http://127.0.0.1:8080/solr/admin/cores?action=STATUS&core=core1
Reload SOLR Core
If you want the configuration changes you have done in schema.xml or solrconfig.xml to take effect without restart of whole instance, you can just reload the specific core you want to reload. By reloading the specific core, your downtime is virtually zero. Use the following URL to load new configuration without restarting.
http://127.0.0.1:8080/solr/admin/cores?action=RELOAD&core=core1
Deleting SOLR core in Runtime
In rare case, where you want to delete or unload the SOLR core, You can do so by visiting,
http://127.0.0.1:8080/solr/admin/cores?action=UNLOAD&core=core1
If you wish to delete the index on unload, you can pass deleteindex as an optional parameter to the URL above with value true.
Refresh SOLR Index
If you want to refresh the index documents in SOLR after deleting the solr index and remove all the documents currently indexed in SOLR, you can use the following URL to perform the SOLR index flush. This URL clears the current SOLR index and does a fresh import from the data source. In case you do not have multiple cores, just remove the core name (core1) from the URL below.
http://127.0.0.1:8080/solr/core1/dataimport?command=full-import
By default, the existing index is cleaned up before indexing starts and the new data is committed after the indexing operation. You can override the behaivour by sending extra parameters,
http://127.0.0.1:8080/solr/core1/dataimport?command=full-import&clean=true&commit=true
If the commit is set to false, the indexed data is not commited. If clean is set to false, the old index is not cleared and stale data will be served.
In case, you want to perfrom a delta import into SOLR, You can do so using the URL below,
http://127.0.0.1:8080/solr/core1/dataimport?command=delta-import
The status of the data import can be monitored at
http://127.0.0.1:8080/solr/core1/dataimport?command=status
Reloading Configuration of DataImportHandler
On configuration changes, you can reload the configuration changes from the file without restarting the SOLR instance by the URL below.
http://127.0.0.1:8080/solr/core1/dataimport?command=reload-config
In case you want to stop the data import operation in SOLR,
http://127.0.0.1:8080/solr/core1/dataimport?command=abort
In case of single core instance, remove the core name (core1) from above URLs and it should work fine.
For more information, see <a href="https://wiki.apache.org/solr/DataImportHandler" "="" title="Official SOLR Wiki" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; vertical-align: baseline; text-decoration: none; color: rgb(2, 7, 85); transition: background-color, color 0.2s linear; -webkit-transition: background-color, color 0.2s linear; -webkit-tap-highlight-color: rgb(255, 94, 153);">Official-Wiki.
转载地址:http://www.installationpage.com/solr/solr-admin-core-commands/
solr没有帮我们api接口的访问控制,我们需要在开发中自己进行控制