SOLR Admin Core Commands

本文提供了一套SOLR核心命令教程,包括查看状态、重新加载配置、删除核心、刷新索引等操作,旨在帮助开发者在不重启实例的情况下进行索引管理与配置调整。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >













LIST OF SOLR ADMIN CORE COMMANDS

SOLR Admin Core Commands

SOLR 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接口的访问控制,我们需要在开发中自己进行控制

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值