Files
bryce-solr/solr/server/solr-webapp/webapp/libs/solr
2026-05-15 22:19:14 -07:00
..
2026-05-15 22:19:14 -07:00
2026-05-15 22:19:14 -07:00
2026-05-15 22:19:14 -07:00

v2_api

V2Api - JavaScript client for v2_api OpenAPI spec for Solr's v2 API endpoints This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 9.6.0
  • Package version: 9.6.0
  • Build package: org.openapitools.codegen.languages.JavascriptClientCodegen

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install v2_api --save

Finally, you need to build the module:

npm run build
Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:

npm install

Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:

npm link

To use the link you just defined in your project, switch to the directory you want to use your v2_api from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

Finally, you need to build the module:

npm run build

git

If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:

    npm install GIT_USER_ID/GIT_REPO_ID --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var V2Api = require('v2_api');


var api = new V2Api.AliasPropertiesApi()
var aliasName = "aliasName_example"; // {String} Alias Name
var propName = "propName_example"; // {String} Property Name
var updateAliasPropertyRequestBody = new V2Api.UpdateAliasPropertyRequestBody(); // {UpdateAliasPropertyRequestBody} Property value that needs to be updated
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createOrUpdateAliasProperty(aliasName, propName, updateAliasPropertyRequestBody, callback);

Documentation for API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
V2Api.AliasPropertiesApi createOrUpdateAliasProperty PUT /aliases/{aliasName}/properties/{propName} Update a specific property for a collection alias.
V2Api.AliasPropertiesApi deleteAliasProperty DELETE /aliases/{aliasName}/properties/{propName} Delete a specific property for a collection alias.
V2Api.AliasPropertiesApi getAliasProperty GET /aliases/{aliasName}/properties/{propName} Get a specific property for a collection alias.
V2Api.AliasPropertiesApi getAllAliasProperties GET /aliases/{aliasName}/properties Get properties for a collection alias.
V2Api.AliasPropertiesApi updateAliasProperties PUT /aliases/{aliasName}/properties Update properties for a collection alias.
V2Api.AliasesApi deleteAlias DELETE /aliases/{aliasName} Deletes an alias by its name
V2Api.AliasesApi getAliasByName GET /aliases/{aliasName} Get details for a specific collection alias.
V2Api.AliasesApi getAliases GET /aliases List the existing collection aliases.
V2Api.ClusterApi balanceReplicas POST /cluster/replicas/balance Balance Replicas across the given set of Nodes.
V2Api.ClusterApi migrateReplicas POST /cluster/replicas/migrate Migrate Replicas from a given set of nodes.
V2Api.CollectionBackupsApi createCollectionBackup POST /collections/{collectionName}/backups/{backupName}/versions Creates a new backup point for a collection
V2Api.CollectionBackupsApi deleteMultipleBackupsByRecency DELETE /backups/{backupName}/versions Delete all incremental backup points older than the most recent N
V2Api.CollectionBackupsApi deleteSingleBackupById DELETE /backups/{backupName}/versions/{backupId} Delete incremental backup point by ID
V2Api.CollectionBackupsApi garbageCollectUnusedBackupFiles PUT /backups/{backupName}/purgeUnused Garbage collect orphaned incremental backup files
V2Api.CollectionBackupsApi listBackupsAtLocation GET /backups/{backupName}/versions List existing incremental backups at the specified location.
V2Api.CollectionPropertiesApi createOrUpdateCollectionProperty PUT /collections/{collName}/properties/{propName} Create or update a collection property
V2Api.CollectionPropertiesApi deleteCollectionProperty DELETE /collections/{collName}/properties/{propName} Delete the specified collection property from the collection
V2Api.CollectionSnapshotsApi createCollectionSnapshot POST /collections/{collName}/snapshots/{snapshotName} Creates a new snapshot of the specified collection.
V2Api.CollectionSnapshotsApi deleteCollectionSnapshot DELETE /collections/{collName}/snapshots/{snapshotName} Delete an existing collection-snapshot by name.
V2Api.CollectionsApi balanceShardUnique POST /collections/{collectionName}/balance-shard-unique Ensure a specified per-shard property is distributed evenly amongst physical nodes comprising a collection
V2Api.CollectionsApi createCollection POST /collections Creates a new SolrCloud collection.
V2Api.CollectionsApi deleteCollection DELETE /collections/{collectionName} Deletes a collection from SolrCloud
V2Api.CollectionsApi listCollections GET /collections List all collections in this Solr cluster
V2Api.CollectionsApi reloadCollection POST /collections/{collectionName}/reload Reload all cores in the specified collection.
V2Api.CollectionsApi renameCollection POST /collections/{collectionName}/rename Rename a SolrCloud collection
V2Api.ConfigsetsApi listConfigSet GET /cluster/configs List the configsets available to Solr.
V2Api.CoreBackupsApi createBackup POST /cores/{coreName}/backups Creates a core-level backup
V2Api.CoreSnapshotsApi createSnapshot POST /cores/{coreName}/snapshots/{snapshotName} Create a new snapshot of the specified core.
V2Api.CoreSnapshotsApi deleteSnapshot DELETE /cores/{coreName}/snapshots/{snapshotName} Delete a single snapshot from the specified core.
V2Api.CoreSnapshotsApi listSnapshots GET /cores/{coreName}/snapshots List existing snapshots for the specified core.
V2Api.CoresApi installCoreData POST /cores/{coreName}/install Install an offline index to a specified core
V2Api.CoresApi mergeIndexes POST /cores/{coreName}/merge-indices The MERGEINDEXES action merges one or more indexes to another index.
V2Api.CoresApi reloadCore POST /cores/{coreName}/reload Reload the specified core.
V2Api.CoresApi renameCore POST /cores/{coreName}/rename The RENAME action changes the name of a Solr core
V2Api.CoresApi restoreCore POST /cores/{coreName}/restore Restore a previously-taken backup to the specified core
V2Api.CoresApi swapCores POST /cores/{coreName}/swap SWAP atomically swaps the names used to access two existing Solr cores.
V2Api.CoresApi unloadCore POST /cores/{coreName}/unload Unloads a single core specified by name
V2Api.NodeApi deleteNode POST /cluster/nodes/{nodeName}/clear Delete all replicas off of the specified SolrCloud node
V2Api.NodeApi getCommandStatus GET /node/commands/{requestId} Request the status of an already submitted asynchronous CoreAdmin API call.
V2Api.NodeApi getPublicKey GET /node/key Retrieve the public key of the receiving Solr node.
V2Api.NodeApi replaceNode POST /cluster/nodes/{sourceNodeName}/replace 'Replace' a specified node by moving all replicas elsewhere
V2Api.QueryingApi jsonQuery POST /{indexType}/{indexName}/select Query a Solr core or collection using the structured request DSL
V2Api.QueryingApi query GET /{indexType}/{indexName}/select Query a Solr core or collection using individual query parameters
V2Api.ReplicaPropertiesApi addReplicaProperty PUT /collections/{collName}/shards/{shardName}/replicas/{replicaName}/properties/{propName} Adds a property to the specified replica
V2Api.ReplicaPropertiesApi deleteReplicaProperty DELETE /collections/{collName}/shards/{shardName}/replicas/{replicaName}/properties/{propName} Delete an existing replica property
V2Api.ReplicasApi createReplica POST /collections/{collectionName}/shards/{shardName}/replicas Creates a new replica of an existing shard.
V2Api.ReplicasApi deleteReplicaByName DELETE /collections/{collectionName}/shards/{shardName}/replicas/{replicaName} Delete an single replica by name
V2Api.ReplicasApi deleteReplicasByCount DELETE /collections/{collectionName}/shards/{shardName}/replicas Delete one or more replicas from the specified collection and shard
V2Api.ReplicasApi deleteReplicasByCountAllShards PUT /collections/{collectionName}/scale Scale the replica count for all shards in the specified collection
V2Api.SchemaApi getSchemaInfo GET /{indexType}/{indexName}/schema Fetch the entire schema of the specified core or collection
V2Api.SchemaApi getSchemaName GET /{indexType}/{indexName}/schema/name Get the name of the schema used by the specified core or collection
V2Api.SchemaApi getSchemaSimilarity GET /{indexType}/{indexName}/schema/similarity Get the default similarity configuration used by the specified core or collection
V2Api.SchemaApi getSchemaUniqueKey GET /{indexType}/{indexName}/schema/uniquekey Fetch the uniquekey of the specified core or collection
V2Api.SchemaApi getSchemaVersion GET /{indexType}/{indexName}/schema/version Fetch the schema version currently used by the specified core or collection
V2Api.SchemaApi getSchemaZkVersion GET /{indexType}/{indexName}/schema/zkversion Fetch the schema version currently used by the specified core or collection
V2Api.ShardsApi createShard POST /collections/{collectionName}/shards Create a new shard in an existing collection
V2Api.ShardsApi deleteShard DELETE /collections/{collectionName}/shards/{shardName} Delete an existing shard
V2Api.ShardsApi forceShardLeader POST /collections/{collectionName}/shards/{shardName}/force-leader Force leader election to occur on the specified collection and shard
V2Api.ShardsApi installShardData POST /collections/{collName}/shards/{shardName}/install Install offline index into an existing shard
V2Api.ShardsApi syncShard POST /collections/{collectionName}/shards/{shardName}/sync Trigger a 'sync' operation for the specified shard

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.