# gatsby-source-elasticsearch

> Gatsby Elasticsearch source plugin

Latest version **0.1.0** (published 2018-06-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install gatsby-source-elasticsearch
pnpm add gatsby-source-elasticsearch
yarn add gatsby-source-elasticsearch
bun add gatsby-source-elasticsearch
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2018-06-14 |
| First published | 2018-06-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 92.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Chad Huntley |
| Maintainers | chuntley |
| Keywords | gatsby, gatsby-plugin, elasticsearch |

## Links

- npm: https://www.npmjs.com/package/gatsby-source-elasticsearch
- Repository: https://github.com/chuntley/gatsby-source-elasticsearch
- Issues: https://github.com/chuntley/gatsby-source-elasticsearch/issues
- npm.io page: https://npm.io/package/gatsby-source-elasticsearch

## Dependencies (1)

- [elasticsearch](https://npm.io/package/elasticsearch.md) ^15.0.0

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2018-06-14

## README

# gatsby-source-elasticsearch

Gatsby source plugin for Elasticsearch.

This plugin uses the Elastisearch Scroll API to obtain any number of documents.

## Installation

```sh
yarn add gatsby-source-elasticsearch
```

## Options

| Option | Description | Type |
| --- | --- | --- |
| connection | Connection details | string, object |
| index | The index to query against | string |
| typeName | The type name to generate in Gatsby | string |
| query | The query to run | string, object |

## Config Examples

### Basic

```js
module.exports = {
  plugins: [
    {
      resolve: 'gatsby-source-elasticsearch',
      options: {
        connection: 'http://localhost:9200',
        index: 'test-*',
        typeName: 'testDocs',
        query: 'type:test'
      },
    },
  ],
};
```

### Advanced Connection Option

If you pass the connection option as an object, you can use [Elasticsearch client configuration options](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/configuration.html).

```js
module.exports = {
  plugins: [
    {
      resolve: 'gatsby-source-elasticsearch',
      options: {
        connection: {
          host: 'http://localhost:9200',
          log: 'info',
        },
        // ...
      },
    },
  ],
};
```

### Advanced Query Option

If you pass the query option as an object, you can build a normal [Elasticsearch search query](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-search). Otherwise, when it is passed in as a string it uses [Elasticsearch query strings](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-uri-request.html)

```js
module.exports = {
  plugins: [
    {
      resolve: 'gatsby-source-elasticsearch',
      options: {
        query: {
          bool: {
            filter: [
              { term: { test: 'this' } },
            ],
          },
        },
        // ...
      },
    },
  ],
};
```
NOTE: This plugin does not support aggregations.

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