Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/sepulworld/solrcluster-client-go

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/sepulworld/solrcluster-client-go

  • v0.0.2
  • Source
  • Go
  • Socket score

Version published
Created
Source

solrcluster-client-go

Go

Go Reference

Go client for managing SolrClusters

Collection API

List Collections
package main

import (
	"fmt"
	"log"

	solrcluster "github.com/sepulworld/solrcluster-client-go"
)

// Get list of collections on a SolrCluster
func main() {
	host := "http://default-example-solrcloud.ing.local.domain"
	resp, err := solrcluster.GetCollections(host)
	if err != nil {
		log.Fatal("Error connecting to solrcloud. ", err)
	}
	fmt.Println("Collections:", resp.Collections)
}
Create Collection
        host := "http://default-example-solrcloud.ing.local.domain"
        collection := solrcluster.SolrCollection{}
        collection.Collection = "power-house-search-collection""
        collection.CollectionConfigName = "_default"
        collection.RouterName = "compositeId"
        collection.NumShards = 2

        createCollection, err := solrcluster.CreateCollection(host, collection)
        if err != nil {
                log.Fatal("Error creating solrcloud. ", err)
        }
        fmt.Println("Collection Created: ", createCollection)
Delete Collection
        host := "http://default-example-solrcloud.ing.local.domain"
        collection := "testCollection"
	resp, err := DeleteCollection(host, collection)
        fmt.Println("Collection Deleted: ", collection)
Rename Collection
        host := "http://default-example-solrcloud.ing.local.domain"
	collection := "testCollection"
	targetName := "newCollectionName"
	resp, err := RenameCollection(host, collection, targetName)
        fmt.Println("Collection Renamed, alias created: ", collection, "alias", targetName)

FAQs

Package last updated on 14 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc