# solr-client

> A Solr client library for indexing, adding, deleting, committing, optimizing and searching documents within an Apache Solr installation (version>=3.2)

Latest version **0.10.0-rc10** (published 2022-03-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install solr-client
pnpm add solr-client
yarn add solr-client
bun add solr-client
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.10.0-rc10 |
| Published | 2022-03-13 |
| First published | 2011-08-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 12 |
| Dependencies | 8 |
| Unpacked size | 205.4 KB |
| Known vulnerabilities | 0 (+27 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 493 |
| Author | Remy Loubradou |
| Maintainers | julianlam, lbdremy, luketaverne, nicolasembleton, kibertoad |
| Keywords | solr, client, query, sdk, search |

## Links

- npm: https://www.npmjs.com/package/solr-client
- Repository: https://github.com/lbdremy/solr-node-client
- Homepage: https://github.com/lbdremy/solr-node-client#readme
- Issues: https://github.com/lbdremy/solr-node-client/issues
- npm.io page: https://npm.io/package/solr-client

## Dependencies (8)

- [hnp](https://npm.io/package/hnp.md) ^1.0.1
- [tslib](https://npm.io/package/tslib.md) ^2.3.1
- [undici](https://npm.io/package/undici.md) ^4.7.1
- [request](https://npm.io/package/request.md) ^2.88.2
- [duplexer](https://npm.io/package/duplexer.md) ^0.1.2
- [JSONStream](https://npm.io/package/JSONStream.md) ^1.3.5
- [json-bigint](https://npm.io/package/json-bigint.md) ^1.0.0
- [proxy-agent](https://npm.io/package/proxy-agent.md) ^5.0.0

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 0.10.0-rc10 (latest) — 2022-03-13
- 0.10.0-rc4 (next) — 2021-08-23
- 0.10.0-rc9 — 2021-12-13
- 0.10.0-rc8 — 2021-10-08
- 0.10.0-rc7 — 2021-09-27
- 0.10.0-rc6 — 2021-08-30
- 0.10.0-rc5 — 2021-08-27
- 0.10.0-rc3 — 2021-08-20
- 0.10.0-rc2 — 2021-08-20
- 0.10.0-rc1 — 2021-08-20
- 0.9.0 — 2021-04-28
- 0.8.0 — 2020-12-31
- 0.7.1 — 2019-09-05
- 0.7.0 — 2017-05-19
- 0.6.0 — 2015-10-09
- … 22 more at https://npm.io/package/solr-client/versions

## README

# solr-client - a node.js solr client
[![NPM Version](https://img.shields.io/npm/v/solr-client.svg)](https://npmjs.org/package/solr-client)
[![NPM Downloads](https://img.shields.io/npm/dm/solr-client.svg)](https://npmjs.org/package/solr-client)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/lbdremy/solr-node-client?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
![](https://github.com/lbdremy/solr-node-client/workflows/CI/badge.svg)

## Installation

Install the library with:

```shell
npm install solr-client
```

or

```shell
yarn add solr-client
```

## Documentation

Node.js version 12+ is supported.
Solr versions 3-8 are supported.

* See the [official documentation](https://lbdremy.github.io/solr-node-client/) for more details.
* If you are upgrading from an earlier version, please see the [migration guide](https://github.com/lbdremy/solr-node-client/blob/master/UPGRADING.md).
* You can also check out the [changelog](https://github.com/lbdremy/solr-node-client/blob/master/CHANGELOG.md).

## Usage (callback API in 0.9.0 and older)

```js
// Load dependency
const solr = require('solr-client');

// Create a client
const client = solr.createClient();

// Add a new document
const obj = await client.add({ id : 12, title_t : 'Hello' });
console.log('Solr response:', obj);
```

## Usage (promise API in 0.10.0+`)

```js
// Load dependency
const solr = require('solr-client');

// Create a client
const client = solr.createClient();

// Add a new document
const obj = await client.add({ id : 12, title_t : 'Hello' });
console.log('Solr response:', obj);
```

## Roadmap

### v0.3.x - v0.x.x

- Implement all features available in Solr 4 (SolrCloud API in particular)
- Provide all low-level commands
- Complete documentation

### v1.0.x

- First stable version
- the API is frozen until v2.0.x, only new features and bug fixes can be introduced

## Test

Tests are executed against a Solr instance in a Docker container. 

To execute them on latest supported Solr version, run:

```shell
npm run solr:current:start
npm run test:current
```

If you want to execute them on oldest Solr version supported, run:

```shell
npm run solr:legacy:start
npm run test:legacy
```
## Windows 10 and Docker

#### Windows 10 Pro or Enterprise

If you have a version of Windows 10 Pro or Enterprise, simply download [Docker Desktop](https://docs.docker.com/desktop/windows/install/). Ensure that Hyper-V is enabled, and [virtualization](https://docs.docker.com/desktop/windows/troubleshoot/#virtualization-must-be-enabled) is enabled in your motherboard's BIOS. It may prompt you to install updates to Windows during Docker Desktop installation and then restart the system.

#### Windows 10 Home

If you have a version of Windows 10 Home, a little more effort is needed. By default, Hyper-V cannot be turned on for Home edition.
**The steps that seem to work:**
- Check to ensure you have WSL1, WSL2, and the Kernel Update. This can be done using the shell commands found [here](https://blog.devgenius.io installing-docker-onwindows-10-home-edition-2e7c1b79d76d). 
- [Follow the instructions in this link](https://www.itechtics.com/enable-hyper-v-windows-10-home/) to install Hyper-V. Please note, that you must have WSL1/WSL2 and the update for Hyper-V to install properly or the changes may be undone during restart.
- After restarting and checking that Hyper-V is enabled, you may install [Docker Desktop](https://docs.docker.com/desktop/windows/install/) using the setup wizard.

## Test coverage

Before to be able to run the command below, you will need to install jscoverage available 
[here](https://github.com/visionmedia/node-jscoverage).

```
npm run-script test-cov
```

This command will generate a file named `coverage.html`, use your browser to visualize it.

## Static analysis and complexity report

```
npm run-script report
```

## Licence

(The MIT License)

Copyright 2011-2012 HipSnip Limited
Copyright 2013-2014 Rémy Loubradou

---
_Source: https://npm.io/package/solr-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
