Apache Solr Documentation

5.3 Ref Guide (PDF Download)
Solr Tutorial
Solr Community Wiki

Older Versions of this Guide (PDF)

5.4 Draft Ref Guide Topics

Meta-Documentation

This Unreleased Guide Will Cover Apache Solr 5.4

Skip to end of metadata
Go to start of metadata

The Collections API is used to enable you to create, remove, or reload collections, but in the context of SolrCloud you can also use it to create collections with a specific number of shards and replicas.

API Entry Points

The base URL for all API calls below is http://<hostname>:<port>/solr.

/admin/collections?action=CREATE: create a collection
/admin/collections?action=RELOAD: reload a collection
/admin/collections?action=SPLITSHARD: split a shard into two new shards
/admin/collections?action=CREATESHARD: create a new shard
/admin/collections?action=DELETESHARD: delete an inactive shard
/admin/collections?action=CREATEALIAS: create or modify an alias for a collection
/admin/collections?action=DELETEALIAS: delete an alias for a collection
/admin/collections?action=DELETE: delete a collection
/admin/collections?action=DELETEREPLICA: delete a replica of a shard
/admin/collections?action=ADDREPLICA: add a replica of a shard
/admin/collections?action=CLUSTERPROP: Add/edit/delete a cluster-wide property
/admin/collections?action=MIGRATE: Migrate documents to another collection
/admin/collections?action=ADDROLE: Add a specific role to a node in the cluster
/admin/collections?action=REMOVEROLE: Remove an assigned role
/admin/collections?action=OVERSEERSTATUS: Get status and statistics of the overseer
/admin/collections?action=CLUSTERSTATUS: Get cluster status
/admin/collections?action=REQUESTSTATUS: Get the status of a previous asynchronous request
/admin/collections?action=LIST: List all collections
/admin/collections?action=ADDREPLICAPROP: Add an arbitrary property to a replica specified by collection/shard/replica
/admin/collections?action=DELETEREPLICAPROP: Delete an arbitrary property from a replica specified by collection/shard/replica
/admin/collections?action=BALANCESHARDUNIQUE: Distribute an arbitrary property, one per shard, across the nodes in a collection
/admin/collections?action=REBALANCELEADERSDistribute leader role  based on the "preferredLeader" assignments

Create a Collection

/admin/collections?action=CREATE&name=name&numShards=number&replicationFactor=number&maxShardsPerNode=number&createNodeSet=nodelist&collection.configName=configname

Input

Query Parameters

Key

Type

Required

Default

Description

name

string

Yes

 

The name of the collection to be created.

router.name

string

No

compositeId

The router name that will be used. The router defines how documents will be distributed among the shards. The value can be either implicit, which uses an internal default hash, or compositeId, which allows defining the specific shard to assign documents to. When using the 'implicit' router, the shards parameter is required. When using the 'compositeId' router, the numShards parameter is required. For more information, see also the section Document Routing.

numShards

integer

No

empty

The number of shards to be created as part of the collection. This is a required parameter when using the 'compositeId' router.

shards

string

No

empty

A comma separated list of shard names, e.g., shard-x,shard-y,shard-z . This is a required parameter when using the 'implicit' router.

replicationFactor

integer

No

1

The number of replicas to be created for each shard.

maxShardsPerNode

integer

No

1

When creating collections, the shards and/or replicas are spread across all available (i.e., live) nodes, and two replicas of the same shard will never be on the same node. If a node is not live when the CREATE operation is called, it will not get any parts of the new collection, which could lead to too many replicas being created on a single live node. Defining maxShardsPerNode sets a limit on the number of replicas CREATE will spread to each node. If the entire collection can not be fit into the live nodes, no collection will be created at all.

createNodeSet

string

No

 

Allows defining the nodes to spread the new collection across. If not provided, the CREATE operation will create shard-replica spread across all live Solr nodes. The format is a comma-separated list of node_names, such as localhost:8983_solr, localhost:8984_solr, localhost:8985_solr. Alternatively, use the special value of EMPTY to initially create no shard-replica within the new collection and then later use the ADDREPLICA operation to add shard-replica when and where required.

createNodeSet.shufflebooleanNotrue

Controls wether or not the shard-replicas created for this collection will be assigned to the nodes specified by the createNodeSet in a sequential manner, or if the list of nodes should be shuffled prior to creating individual replicas.  A 'false' value makes the results of a collection creation predictible and gives more exact control over the location of the individual shard-replicas, but 'true' can be a better choice for ensuring replicas are distributed evenly across nodes.

Ignored if createNodeSet is not also specified.

collection.configName

string

No

empty

Defines the name of the configurations (which must already be stored in ZooKeeper) to use for this collection. If not provided, Solr will default to the collection name as the configuration name.

router.field

string

No

empty

If this field is specified, the router will look at the value of the field in an input document to compute the hash and identify a shard instead of looking at the uniqueKey field. If the field specified is null in the document, the document will be rejected. Please note that RealTime Get or retrieval by id would also require the parameter _route_ (or shard.keys) to avoid a distributed search.

property.name=valuestringNo Set core property name to value. See the section Defining core.properties for details on supported properties and values.
autoAddReplicasbooleanNofalseWhen set to true, enables auto addition of replicas on shared file systems. See the section autoAddReplicas Settings for more details on settings and overrides.
asyncstringNo Request ID to track this action which will be processed asynchronously.
Output

Output Content

The response will include the status of the request and the new core names. If the status is anything other than "success", an error message will explain why the request failed.

Examples

Input

Output

Reload a Collection

/admin/collections?action=RELOAD&name= name

The RELOAD action is used when you have changed a configuration in ZooKeeper.

Input

Query Parameters

Key

Type

Required

Description

name

string

Yes

The name of the collection to reload.

Output

Output Content

The response will include the status of the request and the cores that were reloaded. If the status is anything other than "success", an error message will explain why the request failed.

Examples

Input

Output

Split a Shard

/admin/collections?action=SPLITSHARD&collection=name&shard=shardID

Splitting a shard will take an existing shard and break it into two pieces which are written to disk as two (new) shards. The original shard will continue to contain the same data as-is but it will start re-routing requests to the new shards. The new shards will have as many replicas as the original shard. A soft commit is automatically issued after splitting a shard so that documents are made visible on sub-shards. An explicit commit (hard or soft) is not necessary after a split operation because the index is automatically persisted to disk during the split operation.

This command allows for seamless splitting and requires no downtime. A shard being split will continue to accept query and indexing requests and will automatically start routing them to the new shards once this operation is complete. This command can only be used for SolrCloud collections created with "numShards" parameter, meaning collections which rely on Solr's hash-based routing mechanism.

The split is performed by dividing the original shard's hash range into two equal partitions and dividing up the documents in the original shard according to the new sub-ranges.

One can also specify an optional 'ranges' parameter to divide the original shard's hash range into arbitrary hash range intervals specified in hexadecimal. For example, if the original hash range is 0-1500 then adding the parameter: ranges=0-1f4,1f5-3e8,3e9-5dc will divide the original shard into three shards with hash range 0-500, 501-1000 and 1001-1500 respectively.

Another optional parameter 'split.key' can be used to split a shard using a route key such that all documents of the specified route key end up in a single dedicated sub-shard. Providing the 'shard' parameter is not required in this case because the route key is enough to figure out the right shard. A route key which spans more than one shard is not supported. For example, suppose split.key=A! hashes to the range 12-15 and belongs to shard 'shard1' with range 0-20 then splitting by this route key would yield three sub-shards with ranges 0-11, 12-15 and 16-20. Note that the sub-shard with the hash range of the route key may also contain documents for other route keys whose hash ranges overlap.

Shard splitting can be a long running process. In order to avoid timeouts, you should run this as an asynchronous call.

Input

Query Parameters

Key

Type

Required

Description

collection

string

Yes

The name of the collection that includes the shard to be split.

shard

string

Yes

The name of the shard to be split.

ranges

string

No

A comma-separated list of hash ranges in hexadecimal e.g. ranges=0-1f4,1f5-3e8,3e9-5dc

split.key

string

No

The key to use for splitting the index

property.name=valuestringNoSet core property name to value. See the section Defining core.properties for details on supported properties and values.
asyncstringNoRequest ID to track this action which will be processed asynchronously
Output

Output Content

The output will include the status of the request and the new shard names, which will use the original shard as their basis, adding an underscore and a number. For example, "shard1" will become "shard1_0" and "shard1_1". If the status is anything other than "success", an error message will explain why the request failed.

Examples

Input
Split shard1 of the "anotherCollection" collection.

Output

Create a Shard

Shards can only created with this API for collections that use the 'implicit' router. Use SPLITSHARD for collections using the 'compositeId' router. A new shard with a name can be created for an existing 'implicit' collection.

/admin/collections?action=CREATESHARD&shard=shardName&collection=name

Input

Query Parameters

Key

Type

Required

Description

collection

string

Yes

The name of the collection that includes the shard that will be splitted.

shard

string

Yes

The name of the shard to be created.

createNodeSet

string

No

Allows defining the nodes to spread the new collection across. If not provided, the CREATE operation will create shard-replica spread across all live Solr nodes. The format is a comma-separated list of node_names, such as localhost:8983_solr, localhost:8984_solr, localhost:8985_solr.

property.name=valuestringNoSet core property name to value. See the section Defining core.properties for details on supported properties and values.
Output

Output Content

The output will include the status of the request. If the status is anything other than "success", an error message will explain why the request failed.

Examples

Input
Create 'shard-z' for the "anImplicitCollection" collection.

Output

Delete a Shard

Deleting a shard will unload all replicas of the shard and remove them from clusterstate.json. It will only remove shards that are inactive, or which have no range given for custom sharding.

/admin/collections?action=DELETESHARD&shard=shardID&collection=name

Input

Query Parameters

Key

Type

Required

Description

collection

string

Yes

The name of the collection that includes the shard to be deleted.

shard

string

Yes

The name of the shard to be deleted.

Output

Output Content

The output will include the status of the request. If the status is anything other than "success", an error message will explain why the request failed.

Examples

Input
Delete 'shard1' of the "anotherCollection" collection.

Output

Create or modify an Alias for a Collection

The CREATEALIAS action will create a new alias pointing to one or more collections. If an alias by the same name already exists, this action will replace the existing alias, effectively acting like an atomic "MOVE" command.

/admin/collections?action=CREATEALIAS&name=name&collections=collectionlist

Input

Query Parameters

Key

Type

Required

Description

name

string

Yes

The alias name to be created.

collections

string

Yes

The list of collections to be aliased, separated by commas.

Output

Output Content

The output will simply be a responseHeader with details of the time it took to process the request. To confirm the creation of the alias, you can look in the Solr Admin UI, under the Cloud section and find the aliases.json file.

Examples

Input
Create an alias named "testalias" and link it to the collections named "anotherCollection" and "testCollection".

Output

Delete a Collection Alias

/admin/collections?action=DELETEALIAS&name=name

Input

Query Parameters

Key

Type

Required

Description

name

string

Yes

The name of the alias to delete.

Output

Output Content

The output will simply be a responseHeader with details of the time it took to process the request. To confirm the removal of the alias, you can look in the Solr Admin UI, under the Cloud section, and find the aliases.json file.

Examples

Input
Remove the alias named "testalias".

Output

Delete a Collection

/admin/collections?action=DELETE&name=collection

Input

Query Parameters

Key

Type

Required

Description

name

string

Yes

The name of the collection to delete.

Output

Output Content

The response will include the status of the request and the cores that were deleted. If the status is anything other than "success", an error message will explain why the request failed.

Examples

Input
Delete the collection named "newCollection".

Output

Delete a Replica

/admin/collections?action=DELETEREPLICA&collection=collection&shard=shard&replica=replica

Delete a replica from a given collection and shard. If the corresponding core is up and running the core is unloaded and the entry is removed from the clusterstate. If the node/core is down , the entry is taken off the clusterstate and if the core comes up later it is automatically unregistered.

Input

Query Parameters

Key

Type

Required

Description

collection

string

Yes

The name of the collection.

shard

string

Yes

The name of the shard that includes the replica to be removed.

replica

string

Yes

The name of the replica to remove.

onlyIfDownbooleannoWhen set to 'true' will not take any action if the replica is active. Default 'false'
Examples

Input

Output

Output Content

 Add Replica

/admin/collections?action=ADDREPLICA&collection=collection&shard=shard&node=solr_node_name

Add a replica to a shard in a collection. The node name can be specified if the replica is to be created in a specific node

Input

Query Parameters

Key

Type

Required

Description

collection

string

Yes

The name of the collection.

shard

string

Yes*

The name of the shard to which replica is to be added.

If shard is not specified, then _route_ must be.

_route_stringNo*

If the exact shard name is not known, users may pass the _route_ value and the system would identify the name of the shard.

Ignored if the shard param is also specified.

node

string

No

The name of the node where the replica should be created

instanceDirstringNoThe instanceDir for the core that will be created
dataDirstringNoThe directory in which the core should be created
property.name=valuestringNoSet core property name to value. See Defining core.properties.
asyncstringNoRequest ID to track this action which will be processed asynchronously
Examples

Input

Output

Output Content

Cluster Properties

/admin/collections?action=CLUSTERPROP&name=propertyName&val=propertyValue

Add, edit or delete a cluster-wide property.

Input

Query Parameters

Key

Type

Required

Description

name

string

Yes

The name of the property. The two supported properties names are urlScheme and autoAddReplicas. Other names are rejected with an error.

val

string

Yes

The value of the property. If the value is empty or null, the property is unset.

Output

Output Content

The response will include the status of the request and the properties that were updated or removed. If the status is anything other than "0", an error message will explain why the request failed.

Examples

Input

Output

Migrate Documents to Another Collection

/admin/collections?action=MIGRATE&collection=name&split.key=key1!&target.collection=target_collection&forward.timeout=60

The MIGRATE command is used to migrate all documents having the given routing key to another collection. The source collection will continue to have the same data as-is but it will start re-routing write requests to the target collection for the number of seconds specified by the forward.timeout parameter. It is the responsibility of the user to switch to the target collection for reads and writes after the ‘migrate’ command completes.

The routing key specified by the ‘split.key’ parameter may span multiple shards on both the source and the target collections. The migration is performed shard-by-shard in a single thread. One or more temporary collections may be created by this command during the ‘migrate’ process but they are cleaned up at the end automatically.

This is a synchronous operation and therefore keeping a large read timeout on the invocation is advised. The request may still timeout due to inherent limitations of the Collection APIs but that doesn’t necessarily mean that the operation has failed. Users should check logs, cluster state, source and target collections before invoking the operation again.

This command works only with collections having the compositeId router. The target collection must not receive any writes during the time the migrate command is running otherwise some writes may be lost.

Please note that the migrate API does not perform any de-duplication on the documents so if the target collection contains documents with the same uniqueKey as the documents being migrated then the target collection will end up with duplicate documents.

Input

Query Parameters

Key

Type

Required

Description

collection

string

Yes

The name of the source collection from which documents will be split.

target.collection

string

Yes

The name of the target collection to which documents will be migrated.

split.keystringYesThe routing key prefix. For example, if uniqueKey is a!123, then you would use split.key=a!.
forward.timeoutintNoThe timeout, in seconds, until which write requests made to the source collection for the given split.key will be forwarded to the target shard. The default is 60 seconds.
property.name=valuestringNoSet core property name to value. See the section Defining core.properties for details on supported properties and values.
asyncstringNoRequest ID to track this action which will be processed asynchronously.
Output

Output Content

The response will include the status of the request.

Examples

Input

Output 

Add Role

/admin/collections?action=ADDROLE&role=roleName&node=nodeName

Assign a role to a given node in the cluster.  The only supported role as of 4.7 is 'overseer' . Use this API to dedicate a particular node as Overseer. Invoke it multiple times to add more nodes. This is useful in large clusters where an Overseer is likely to get overloaded . If available, one among the list of nodes which are assigned the 'overseer' role would become the overseer.  The system would  assign the role to any other node if none of the designated nodes are up and running 

Input

Query Parameters

Key

Type

Required

Description

role

string

Yes

The name of the role. The only supported role as of now is overseer.

node

string

Yes

The name of the node. It is possible to assign a role even before that node is started.

Output

Output Content

The response will include the status of the request and the properties that were updated or removed. If the status is anything other than "0", an error message will explain why the request failed.

 

Examples

Input

Output 

Remove Role

/admin/collections?action=REMOVEROLE&role=roleName&node=nodeName

Remove an assigned role. This API is used to undo the roles assigned using ADDROLE operation

Input

Query Parameters

Key

Type

Required

Description

role

string

Yes

The name of the role. The only supported role as of now is overseer.

node

string

Yes

The name of the node.

Output

Output Content

The response will include the status of the request and the properties that were updated or removed. If the status is anything other than "0", an error message will explain why the request failed.

Examples

Input

Output 

Overseer status and statistics

/admin/collections?action=OVERSEERSTATUS

Returns the current status of the overseer, performance statistics of various overseer APIs as well as last 10 failures per operation type.

Examples

Input:

Cluster Status

/admin/collections?action=CLUSTERSTATUS

Fetch the cluster status including collections, shards, replicas, configuration name as well as collection aliases and cluster properties.

Input

Query Parameters

Key

Type

Required

Description

collection

string

No

The collection name for which information is requested. If omitted, information on all collections in the cluster will be returned.

shard

string

No

The shard(s) for which information is requested. Multiple shard names can be specified as a comma separated list.

Output

Output Content

The response will include the status of the request and the cluster status.

 

Examples

Input

Output 

Request Status

/admin/collections?action=REQUESTSTATUS&requestid=request-id

Request the status and response of an already submitted Asynchronous Collection API call. This call is also used to clear up the stored statuses (See below).

Input

Query Parameters

Key

Type

Required

Description

requestid

string

Yes

The user defined request-id for the request. This can be used to track the status of the submitted asynchronous task. -1 is a special request id which is used to cleanup the stored states for all of the already completed/failed tasks.

Examples

Input: Valid Request Status

Output 

Input: Invalid RequestId

Output 

Input: Clearing up all the stored statuses

List Collections

/admin/collections?action=LIST

Fetch the names of the collections in the cluster.

 

Example

Input

Output 

Add Replica Property

/admin/collections?action=ADDREPLICAPROP&collection=collectionName&shard=shardName&replica=replicaName&property=propertyName&property.value=value

Assign an arbitrary property to a particular replica and give it the value specified. If the property already exists, it will be overwritten with the new value. 

Input

Query Parameters

Key

Type

Required

Description

collection

string

Yes

The name of the collection this replica belongs to.

shard

string

Yes

The name of the shard the replica belongs to.

replicastringYesThe replica, e.g. core_node1.
property (1)stringYes

The property to add. Note: this will have the literal 'property.' prepended to distinguish it from system-maintained properties. So these two forms are equivalent:

property=special

and

property=property.special

property.valuestringYesThe value to assign to the property.
shardUnique (1)BooleanNodefault: false. If true, then setting this property in one replica will remove the property from all other replicas in that shard.

(1) There is one pre-defined property "preferredLeader" for which shardUnique is forced to 'true' and an error returned if shardUnique is explicitly set to 'false'. PreferredLeader is a boolean property, any value assigned that is not equal (case insensitive) to 'true' will be interpreted as 'false' for preferredLeader. 

Output

Output Content

The response will include the status of the request. If the status is anything other than "0", an error message will explain why the request failed.

Examples

Input: This command would set the preferredLeader (property.preferredLeader) to true on core_node1, and remove that property from any other replica in the shard.

Output 

Input: This pair of commands will set the "testprop" (property.testprop) to 'value1' and 'value2' respectively for two nodes in the same shard. 

Input: This pair of commands would result in core_node_3 having the testprop (property.testprop) value set because the second command specifies shardUnique=true, which would cause the property to be removed from core_node_1.

Delete Replica Property

/admin/collections?action=DELETEREPLICAPROP&collection=collectionName&shard=shardName&replica=replicaName&property=propertyName

Deletes an arbitrary property from a particular replica.

Input

Query Parameters

Key

Type

Required

Description

collection

string

Yes

The name of the collection this replica belongs to

shard

string

Yes

The name of the shard the replica belongs to.

replicastringYesThe replica, e.g. core_node1.
propertystringYes

The property to add. Note: this will have the literal 'property.' prepended to distinguish it from system-maintained properties. So these two forms are equivalent:

property=special

and

property=property.special

Output

Output Content

The response will include the status of the request. If the status is anything other than "0", an error message will explain why the request failed.

 

Examples

Input: This command would delete the preferredLeader (property.preferredLeader) from core_node1.

 

Output: 

Balance a  Property

/admin/collections?action=BALANCESHARDUNIQUE&collection=collectionName&property=propertyName

Insures that a particular property is distributed evenly amongst the physical nodes that make up a collection. If the property already exists on a replica, every effort is made to leave it there. If the property is not on any replica on a shard one is chosen and the property is added.

Input

Query Parameters

Key

Type

Required

Description

collection

string

Yes

The name of the collection to balance the property in.

property

string

Yes

The property to balance. The literal "property." is prepended to this property if not specified explicitly.

onlyactivenodesbooleanNoDefaults to true. Normally, the property is instantiated on active nodes only. If this parameter is specified as "false", then inactive nodes are also included for distribution.
shardUniquebooleanNo

Something of a safety valve. There is one pre-defined property (preferredLeader) that defaults this value to "true". For all other properties that are balanced, this must be set to "true" or an error message is returned.

Output

Output Content

The response will include the status of the request. If the status is anything other than "0", an error message will explain why the request failed.

 

Examples

Input: Either of these commands would put the "preferredLeader" property on one replica in every shard in the "collection1" collection.

 

Output: 

Examining the clusterstate after issuing this call should show exactly one replica in each shard that has this property.

Rebalance Leaders

Reassign leaders in a collection according to the preferredLeader property across active nodes.

/admin/collections?action=REBALANCELEADERS&collection=collectionName

Assigns leaders in a collection according to the preferredLeader property on active nodes. This command should be run after the preferredLeader property has been assigned via the BALANCESHARDUNIQUE or ADDREPLICAPROP commands. NOTE: it is not required that all shards in a collection have a preferredLeader property. Rebalancing will only attempt to reassign leadership to those replicas that have the preferredLeader property set to "true" and are not currently the shard leader and are currently active.

Input

Query Parameters

Key

Type

Required

Description

collection

string

Yes

The name of the collection to rebalance preferredLeaders on.

maxAtOnce

string

No

The maximum number of reassignments to have queue up at once. Values <=0 are use the default value Integer.MAX_VALUE. When this number is reached, the process waits for one or more leaders to be successfully assigned before adding more to the queue.

maxWaitSecondsstringNoDefaults to 60. This is the timeout value when waiting for leaders to be reassigned. NOTE: if maxAtOnce is less than the number of reassignments that will take place, this is the maximum interval that any single wait for at least one reassignment. For example, if 10 reassignments are to take place and maxAtOnce is 1 and maxWaitSeconds is 60, the upper bound on the time that the command may wait is 10 minutes.
Output

Output Content

The response will include the status of the request. If the status is anything other than "0", an error message will explain why the request failed.

 

Examples

Input: Either of these commands would cause all the active replicas that had the "preferredLeader" property set and were not already the preferred leader to become leaders.

 

Output: In this example, two replicas in the  "alreadyLeaders" section already had the leader assigned to the same node as the preferredLeader property so no action was taken. The replica in the "inactivePreferreds" section had the preferredLeader property set but the node was down and no action was taken. The three nodes in the "successes" section were made leaders because they had the preferredLeader property set but were not leaders and they were active.

Examining the clusterstate after issuing this call should show that every live node that has the "preferredLeader" property should also have the "leader" property set to true.

Asynchronous Calls

Since some collection API calls can be long running tasks e.g. Shard Split, you can optionally have the calls run asynchronously. Specifying async=<request-id> enables you to make an asynchronous call, the status of which can be, at any point requested using the REQUESTSTATUS call.

As of now, the REQUESTSTATUS does not automatically cleanup the tracking data structures i.e. the status of completed/failed tasks stays stored in ZooKeeper unless cleared manually. Sending a REQUESTSTATUS call with requestid of -1 clears the stored statuses. However, there is a limit of 10,000 on the number of async call responses stored in a cluster.

 

Example

Input

Output 

37 Comments

  1. Here are some suggested changes for 4.4 to update this page for DELETESHARD action:

    EDIT: suggestions applied to doc

  2. Typo in the "Input" section of "Delete a shard":

    The texts say "...shard to be split." instead of "...shard to be deleted"

    1. Thanks Jan, those should be fixed now.

  3. Cross-referencing comments from Shards and Indexing Data in SolrCloud page:

    The new stuff from SOLR-4221 is fine in this page page, but the Shards and Indexing Data in SolrCloud page also needs to be updated with more conceptual information to describe the new capabilities - particularly the differences between the two router types and when to use them.

  4. Create shard has a typo: 

    /admin/collections?action=CREATEESHARD&shard=shardName&collection=name

    should be:

    /admin/collections?action=CREATESHARD&shard=shardName&collection=name

  5. addReplica is implemented via SOLR-5130 It would be nice if documentation includes it.

  6. I don't see a way to specify the data folder during a Collection CREATE command. Does it just default to storing the data in a folder called data inside the new core folder? Could I create a Collection, then update the core.properties file to specify a different data directory and then reload it? Is that the procedure for that scenario?

    1. The CREATE command supports passing core properties as well. For example, you can specify property.dataDir=/path/to/data. However the same property is passed to all cores in this case.

  7. https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-api17

    Here in the Examples Input the Action should be OVERSEERSTATUS instead of CLUSTERSTATUS

  8. In the CREATE collection API call the replicationFactor default should be '1' instead of 'null' right?

    1. Fixed, thanks Varun! I also fixed the part where it said replicationFactor is a required param for a CREATE collection call.

  9. When I call CREATE API with the 'property.name=mycorename', it does not honour this call and creates a core name as 'mycollectionname_shard1_replica1' and so on..

     

    1. Yashveer: I'm not certain, but i suspect this is deliberate?

      In any case, i've created SOLR-6719 to investigate

       

  10. The "processed asynchronously" link in the "async" key on api1 doesn't navigate to the "Asynchronous Calls" correctly.

    1. fixed - the section had been reformated so that it didn't have a proper section headering (so there was no anchor with that name)

  11. Hi All

    Im using solrcloud 4.10.2 with zookeepr 3.4.6. there are 3 zk servers and 4 solr instances. deployed on weblogic 12c server. zookeeper and solr servers are running without any issue. all 3 zk servers are separate physical servers. i have tested this configuration in locally using virtual servers and its working fine. but in the production servers everytime im getting below timeout exception when issue any of the collection API commands. please help

    command

    http://<host>:<port>/solr/admin/collections?action=CREATE&name=en-collection&numShards=1&replicationFactor=4&collection.configName=conf_en


    Exception

    null:org.apache.solr.common.SolrException: createcollection the collection time out:180s
    	at org.apache.solr.handler.admin.CollectionsHandler.handleResponse(CollectionsHandler.java:368)
    	at org.apache.solr.handler.admin.CollectionsHandler.handleResponse(CollectionsHandler.java:320)
    	at org.apache.solr.handler.admin.CollectionsHandler.handleCreateAction(CollectionsHandler.java:486)
    	at org.apache.solr.handler.admin.CollectionsHandler.handleRequestBody(CollectionsHandler.java:148)
    	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
    	at org.apache.solr.servlet.SolrDispatchFilter.handleAdminRequest(SolrDispatchFilter.java:729)
    	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:267)
    	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:207)
    	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
    	at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3367)
    	at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3333)
    	at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    	at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    	at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
    	at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2220)
    	at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2146)
    	at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2124)
    	at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1564)
    	at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:254)
    	at weblogic.work.ExecuteThread.execute(ExecuteThread.java:295)
    	at weblogic.work.ExecuteThread.run(ExecuteThread.java:254)
    1. if you need assistance using solr, please send am email to the solr-user mailing list...

      https://lucene.apache.org/solr/resources.html#mailing-lists

      Comments on the ref guide should be reserved for pointing out specific problems/suggestions with the documentation itself or asking for clarification of the specific wording in the docs.

       

    1. Thanks Angelnia. I missed these links the other day, but they should be fixed now.

  12. Due to a question on #solr, I was looking at ADDREPLICA docs here.  It says that the only required parameter for this is collection ... but the docs don't indicate what happens if you use this command on a sharded collection and don't tell it what shard to work on.  Will it add replicas to all shards?  Will it find the first shard and add a replica to only that shard?  I presume that if you don't include node, it will try to balance things as much as possible, but that is not indicated either.

    1. there was a note in the table row for the shard param that said "Either shard or _route_ must be provided" but it was definitely confusing - I updated the "Required" column to try and draw attention to this, and clarified that note in both the relevant table rows.

       

      the node assignment when not specified is a trickier subject, not specific to ADDREPLICA – the same question about how nodes are picked for new cores affects everything from CREATE, CREATESHARD, SHARDSPLIT, etc... – someone who understands the basic logic should really right a new section on that, and we should link to it from any admin command where params like "node" and "createNodeSet" are optional

  13. The example for the CLUSTERPROP API needs a small correction - The val needs to change from "https://" to "https". 

    http://localhost:8983/solr/admin/collections?action=CLUSTERPROP&name=urlScheme&val=https://

     

     

  14. The ADDREPLICA call takes another parameter which is not documented - "name" . 

    "name" -Explicitly define the name of the replica (optional) . If it is not specified, generic names will be given to the replica

  15. This page should probably present the preconditions for using the API (e.g., need for configuration to already be held in ZK) at the top, rather than barely mentioning them in parameter descriptions. 

  16. May make sense to shorten the example output for OVERSEERSTATUS? It's like 5 complete pages in the pdf version, and it's just an example output. 

    1. yeah – i went ahead and pruned both OVERSEERSTATUS and CLUSTERSTATUS with generous handfuls of "..." but tried to make sure that the overall structure & nature of the types of data that are returned was still self evident.

  17. amazing resizeful cluster,but I have a little question about split a shard which shard name=shard1:

    1.by default,new shard name are (shard1_0,shard1_1),how can I make them to (shard1_x,shard1_y)–>assign new two subshards names?

    2.by default,before create new shard,solr will create new core on disk and named it by its own rules,can I named it by myself?

    3.at last,split a shard,can solr make sure new shard on which machine or JVM instance that I want them to be -->assign IP address and ports to new subshard ?

    BTW,about why me concern this ? our system has two clusters,one is online,the other one is offline , offline cluster can do full index for  our bussiness,then async to online,so ,u know.

  18. As far as I know, the names of the shards created by splitting are not configurable.  Shard splitting really should be considered a band-aid ... it's far better to follow these steps to re-shard:

    • Create a new collection with the number of shards you need, co-existing with the original collection.
      • If the original collection is named "foo" then you can name the new one something like foo_2015-05-29-001.
    • Index your data into the new collection.
      • In the meantime, if you like, you can continue to update the original collection just like you normally would.
    • Completely delete the old collection.
    • Set up a collection alias pointing the original name to the new collection.

    For subsequent re-shards or complete re-indexes, you can simply recreate the alias, changing where it points.

  19. I got 2 questions for "SPLITSHARD" action:

    1. In "Split a shard" paragraph, it said "break into two pieces...as two(new) shards" and I also remember somewhere in SolrCloud section, it said currently only support splitting into two shards. Then why there's an example as this "ranges=0-1f4,1f5-3e8,3e9-5dc will divide the original shard into three shards with hash range 0-500, 501-1000 and 1001-1500 respectively"?
    2. Why each new core name is repeated twice in response header? 
    1. Hi Scott,

      Thanks for pointing that out. I've fixed the documentation to make it clear that by-default, the splitshard call splits the shard into 2, unless the optional parameter ' ranges ' is used.

      What do you mean by the core name being repeated twice in the response header? Can you use the mailing list for that question ?

      1. In the output, there're:

            <lst>
              <lst name="responseHeader">
                <int name="status">0</int>
                <int name="QTime">3673</int>
              </lst>
              <str name="core">anotherCollection_shard1_1_replica1</str>
            </lst>
            <lst>
              <lst name="responseHeader">
                <int name="status">0</int>
                <int name="QTime">3681</int>
              </lst>
              <str name="core">anotherCollection_shard1_0_replica1</str>
            </lst>
             .....
             .....
              <str name="core">anotherCollection_shard1_1_replica1</str>
              <str name="status">EMPTY_BUFFER</str>
            </lst>
            <lst>
              <lst name="responseHeader">
                <int name="status">0</int>
                <int name="QTime">0</int>
              </lst>
              <str name="core">anotherCollection_shard1_0_replica1</str>
              <str name="status">EMPTY_BUFFER</str>
            </lst>
          </lst>
        You can see each of the core names repeats twice in the output. I don't understand why not to incorporate them into just once for each core name.
        1. You are right, Scott. Actually, the Collection API's responses are mostly useless and comprise of the responses from individual Core Admin API calls made to individual nodes. We need to improve them to make it meaningful but that hasn't happened yet. Please feel free to create an issue on the Solr JIRA and we can work towards improving them. Patches welcome, as always! (smile)

  20. In the example of "Balance a Property" the action should be BALANCESHARDUNIQUE