In this article, we will discuss the available Apache Solr REST APIs. We will categorize the REST APIs as shown below.
Data Import REST APIs:
Command: full-import
Description: This will start the new indexing thread to index the data.
Resource URL: http:// < host >:/solr/<solr_core_name>/dataimport?command=full-import
Parameters:
- clean – The default value is false. This tells whether to clean up the index before the indexing is started.
- commit – The default value is true. This tells whether to commit the index after the operation.
- debug – The default value is false. This is helpful to understand what is going during the indexing.
- entity – This tells the Solr to index which entity. If nothing is passed all the entities are executed.
- optimize – The default value is true. This tells whether to optimize the index after the operation.
Command: delta-import
Description: This will the changes and index only the changes happened from the last full-import.
Resource URL: http:// < host >:/solr/<solr_core_name>/dataimport?command=delta-import
Parameters:
- clean – The default value is false. This tells whether to clean up the index before the indexing is started.
- commit – The default value is true. This tells whether to commit the index after the operation.
- debug – The default value is false. This is helpful to understand what is going during the indexing.
- entity – This tells the Solr which entity to index. If nothing is passed all the entities are executed.
- optimize – The default value is true. This tells whether to optimize the index after the operation.
Command: abort
Description: aborts the running process. For example, during the indexing, if we want to stop it, we can use abort operation.
Resource URL: http:// :/solr/<solr_core_name>/dataimport?command=abort
Command: reload-config
Description: If we want to reload the configuration changes with out restarting the Solr, we can use reload-config.
Resource URL: http:// :/solr/<solr_core_name>/dataimport?command=reload-config
Command: status
Description: It returns the statistics on number of documents indexed, no of documents deleted etc..
Index Replication REST APIs:
Command: indexversion
Description: To know the latest index version on the Master.
Resource URL: http:// master_host:port/solr/replication?command=indexversion
Command: abortfetch
Description: It aborts the copying of index from master to slave.
Resource URL: http:// slave_host:port/solr/replication?command=abortfetch
Command: backup
Description: It helps to take the periodic backups of the index from master.
Resource URL: http:// master_host:port/solr/replication?command=backup
Parameters:
- location – to specify where to keep the backups.
- numberToKeep – to specify how many backups to retain on the location of the specified backups.
Command: fetchIndex
Description: To force the index to replicate from master to slave.
Resource URL: http:// slave_host:port/solr/replication?command=fetchindex
Command: disablepoll
Description: Disable the polling from slave for the index changes.
Resource URL: http:// slave_host:port/solr/replication?command=disablepoll
Command: enablepoll
Description: Enable polling for changes.
Resource URL: http:// slave_host:port/solr/replication?command=enablepoll
Command: details
Description: To get all the configuration details.
Resource URL: http:// slave_host:port/solr/replication?command=details
Command: indexversion
Description: To get the latest index version.
Resource URL: http:// host:port/solr/replication?command=indexversion
Command: disablereplication
Description: To disable the replication for all slaves.
Resource URL: http:// master_host:port/solr/replication?command=disablereplication
Command: enablereplication
Description: To enable the replication for all slaves from master.
Resource URL: http:// master_host:port/solr/replication?command=enablereplication
CoreAdminHandler REST APIs:
Command: STATUS
Description: To know the status of a given core or all.
Resource URL: http:// :/solr/admin/cores?action=STATUS
Parameters:
- core – to know only the specified core status.
Command: RELOAD
Description: To load a new core from the existing configuration.
Resource URL: http:// :/solr/admin/cores?action=RELOAD&core=core0
Command: RENAME
Description: To rename the Solr cores.
Resource URL: http:// :/solr/admin/cores?action=RENAME&core=core0&other=core5
Command: SWAP
Description: To swap the names of the cores.
Resource URL: http:// <host>:<port>/solr/admin/cores?action=SWAP&core=core1&other=core0
Command: UNLOAD
Description: Removes a core from Solr.
Resource URL: http:// <host>:<port>/solr/admin/cores?action=UNLOAD&core=core0
Happy learning !!!
Do we have any EndPoint URL’s to Add/Update field in solr?
You can update specific documents as every document has the unique id. That way if you want you can update the specific field of the document. But you have to update entire document.