Socket
Socket
Sign inDemoInstall

@pimred/solrcloud

Package Overview
Dependencies
20
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @pimred/solrcloud

Connect to a SolrCloud in node.js.


Version published
Weekly downloads
11
increased by22.22%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

SolrCloud client

Connect to a SolrCloud in node.js.

This library uses Zookeeper to determine the connection to the SolrCloud and returns an instance of Axios that can be used to send requests to the Solr node.

A list of Solr nodes is being retrieved from Zookeeper. The Solr node is being selected randomly.

A basic failover implementation is done by selecting a new node if a request fails.

Installation

npm install --save @pimred/solr-cloud

Usage

const solrCloud = require('@pimred/solr-cloud')

const options = {
  zkConnectionString: 'Connection to Zookeeper',
  collection: 'Name of the Solr collection'
}

solrCloud.createClient(options).then(client => {
  client.get('select', {
    params: {
      q: '*:*'
    }
  }).then(response => console.log(response.data))
})

API documentation

createClient(options)

This creates the Solr client which is in fact an instance of axios.

Options

NameRequiredDescription
zkConnectionStringxConnection string to Zookeeper|
collectionxName of the collection in Solr
maxRetriesMaximum number of retries when handling a failed request to Solr
zkConnectionString

https://github.com/alexguan/node-zookeeper-client#documentation

connectionString String - Comma separated host:port pairs, each represents a ZooKeeper server. You can optionally append a chroot path, then the client would be rooted at the given path. e.g.

'localhost:3000,locahost:3001,localhost:3002'
'localhost:2181,localhost:2182/test'

escapeSpecialChars(input)

Escape special characters that are part of the query syntax of Lucene

Options

NameRequiredDescription
inputxstring to escape

Keywords

FAQs

Last updated on 06 Jul 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc