Use http to manage SOLR core and implement Index classification

Source: Internet
Author: User
Tags solr

View the status of all cores

Example

Http: // 172.1663.233: 8983/SOLR/admin/cores? Action = Status

View the status of a core Http: // 172.1663.233: 8983/SOLR/admin/cores? Action = Status & core = collection3
Create a core

You must provide the corename, instance path, config configuration, schema file, and data directory,

Instancedir must be. config and schema & datadir are optional.

Http: // 172.1663.233: 8983/SOLR/admin/cores? Action = create & name = core4 & instancedir =/home/SOLR/solrhome/core4/& Config = solrconfig. xml & schema = schema. xml & datadir = Data

Http: // 172.1663.233: 8983/SOLR/admin/cores? Action = create & name = core4 & instancedir =/home/SOLR/solrhome/core5

You need to create the directory specified by instancedir in advance and copy the conf files of other cores to this directory.

Solr4.3 supports two optional parameters

Loadonstartup = [true | false]-determines whether to load the core When SOLR is started or waiting for the first reference.
Transient = [true | false]-determines whether to automatically detach an instantaneous core when it exceeds the cache size of the instantaneous core. It can be specified in the core label
  Restart Core Http: // 172.1663.233: 8983/SOLR/admin/cores? Action = reload & core = collection2

When the solrconfig. xml or schema. xml file changes (new fields, default parameter changes, etc.), it must be reloaded, but do not stop or restart the entire servlet container.

Rename a core Http: // 172.1663.233: 8983/SOLR/admin/cores? Action = rename & core = core4 & Other = core44
Exchange two existing Cores Use the swap command on two existing cores. The main user places the new core in ondeck, and the original core facilitates roll-back and other operations.

Http: // 172.1663.233: 8983/SOLR/admin/cores? Action = swap & core = core1 & Other = core0
Merge Indexes Http: // 172.1663.233: 8983/SOLR/admin/cores? Action = mergeindexes & core = core0 & srccore = core1 & srccore = core2

The preceding command combines the indexes of core1 and core2 into core0. The data path is defined in admin/SOLR. xml.
Note
1. before executing this command, make sure that the commit operation is called on core1 and core2 (disable indexwriter) at the same time, there is no write operation between core1 and core2 before the operation is completed.

2. if too many indexes cannot be merged, the index of core0 will crash. In addition, once the index is completed, make sure that the search is performed on core0.

3. If core0 does not exist, no new core0 will be created. Therefore, ensure that core0 must be compatible with both core1 and core2,

In addition, after solr3.3, coreadminhandler also transmits the core scheme of the path so far. In earlier versions, it uses indexdir to specify
Http: // localhost: 8983/SOLR/admin/cores? Action = mergeindexes & core = core0 & indexdir =/opt/SOLR/core1/data/index & indexdir =/opt/SOLR/core2/data/Index
Separated split of Indexes After solr4.3, two or more indexes are separated. It accepts the following parameters:
"Core"-the index under this core will be split
"Path"-parameters for splitting to Multiple indexes
"Targetcore"-target core, which must be at the specified merged location
Note that either path or tartgetcore must be specified.

Http: // localhost: 8983/SOLR/admin/cores? Action = Split & core = core0 & targetcore = core1 & targetcore = core2
Http: // localhost: 8983/SOLR/admin/cores? Action = Split & core = core0 & Path =/path/to/index/1 & Path =/path/to/index/2
This command is usually used as an API for solrcloud to separate shard sets. It can also be used in a non-solrcloud-SOLR environment. When a non-cloud core is used, the original index is separated into multiple index documents of the same amount.
Detach a core Http: // 172.1663.233: 8983/SOLR/admin/cores? Action = unload & core = collection1
Http: // 172.1663.233: 8983/SOLR/admin/cores? Action = unload & core = collection2 & deleteindex = true

Deleteindex is mainly used to delete the index of the detached core.
Deletedatadir
Deleteinstancedir: Delete the instance directory and delete all files related to this core, such as index files and configuration files. Note that there is also a bug where you need to specify an absolute path to achieve this.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.