# netlify-plugin-algolia-export

> Netlify plugin to build a search index and export to Algolia

Latest version **1.0.2** (published 2020-06-25) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install netlify-plugin-algolia-export
pnpm add netlify-plugin-algolia-export
yarn add netlify-plugin-algolia-export
bun add netlify-plugin-algolia-export
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2020-06-25 |
| First published | 2020-06-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 13 |
| Unpacked size | 16.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Luke Oliff |
| Maintainers | lukeoliff |
| Keywords | netlify, netlify-plugin, algolia, search, serverless |

## Links

- npm: https://www.npmjs.com/package/netlify-plugin-algolia-export
- Repository: https://github.com/lukeocodes/netlify-plugin-algolia-export
- Homepage: https://github.com/lukeocodes/netlify-plugin-algolia-export#readme
- Issues: https://github.com/lukeocodes/netlify-plugin-algolia-export/issues
- npm.io page: https://npm.io/package/netlify-plugin-algolia-export

## Dependencies (13)

- [chalk](https://npm.io/package/chalk.md) ^4.1.0
- [vfile](https://npm.io/package/vfile.md) ^4.1.0
- [globby](https://npm.io/package/globby.md) ^11.0.0
- [unified](https://npm.io/package/unified.md) ^9.0.0
- [stopword](https://npm.io/package/stopword.md) ^1.0.1
- [parse-latin](https://npm.io/package/parse-latin.md) ^4.2.1
- [rehype-parse](https://npm.io/package/rehype-parse.md) ^7.0.1
- [algoliasearch](https://npm.io/package/algoliasearch.md) ^4.3.0
- [nlcst-to-string](https://npm.io/package/nlcst-to-string.md) ^2.0.4
- [unist-util-visit](https://npm.io/package/unist-util-visit.md) ^2.0.2
- [unist-util-remove](https://npm.io/package/unist-util-remove.md) ^2.0.0
- [hast-util-to-nlcst](https://npm.io/package/hast-util-to-nlcst.md) ^1.2.7
- [hast-util-is-element](https://npm.io/package/hast-util-is-element.md) ^1.0.4

## 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

- 1.0.2 (latest) — 2020-06-25
- 1.0.1 — 2020-06-25

## README

![](https://img.shields.io/badge/main-not%20master-green)
![](https://img.shields.io/badge/made%20with-%E2%9D%A4-red)
![](https://img.shields.io/npm/v/netlify-plugin-algolia-export)
![](https://img.shields.io/github/contributors/lukeocodes/netlify-plugin-algolia-export)
![](https://img.shields.io/github/issues/lukeocodes/netlify-plugin-algolia-export)

# Netlify Algolia Index Export

Netlify plugin to build a search index and export to Algolia. Newer version of [netlify-plugin-algolia-index](https://github.com/lukeocodes/netlify-plugin-algolia-index), this one instead exports directly to Algolia.

## Demo

- Demo site: https://netlify-plugins-by-lukeocodes.netlify.app

## Usage

To install, add the plugin in your `netlify.toml` or use the Netlify plugin directory. No config is required but we show the default options below.

```toml
[[plugins]]
  package = "netlify-plugin-algolia-export"
```

***Add algolia config to your deploy environment variables.***

![Add algolia config to your deploy environment variables](https://user-images.githubusercontent.com/956290/85300382-63c66400-b49e-11ea-82a9-045ac58f26e5.png)

Set `ALGOLIA_APPLICATION_ID`, `ALGOLIA_ADMIN_KEY`, and `ALGOLIA_INDEX` using environment variables: https://docs.netlify.com/configure-builds/environment-variables

These values can be found on the Your API Keys page on your Algolia Dashboard.

![Algolia Dashboard showing Your API Keys](https://user-images.githubusercontent.com/956290/85300545-983a2000-b49e-11ea-9170-8818a66d7d9b.png)

## Options

The available options.

| plugins.inputs  | type  | required  | default  | description  |
|---|---|---|---|---|
| exclude | Array | false | `[]` | An array of paths to exclude from the build. e.g. `['/admin', '/404.html']` |
| textLength | Number | false | `7000` | The length the body of the page content will be truncated to. This is due to indexing limitations on community versions of Algolia, which we assume is the default. |
| stopwords | Array | false | `[]` | Additional stopwords. @see [stopword](https://github.com/fergiemcdowall/stopword) |

## Examples

### Exclude files

Your project probably contains some content files that you don't want your users to search. Pass an array of paths (or regex) to the files you don’t want to be indexed.

```toml
[[plugins]]
  package = "netlify-plugin-algolia-export"
    [plugins.inputs]
      exclude = ['''^\/admin.*''', '''^\/search.*''', '/404.html']
```

### Exclude Everything BUT Blog Posts

Advanced Regex Alert! This will exclude all files that DON'T match the regex for URLs like `/blog/(year)/(month)/(day)/(slug)/index.html`.

```toml
[[plugins]]
  package = "netlify-plugin-algolia-export"
    [plugins.inputs]
      exclude = ['''^\/(?!blog\/[0-9]{4}\/[0-9]{2}\/[0-9]{2}\/(?!index.html)).*''']
```

## Credit

Based on the [Netlify Search Index Plugin](https://github.com/sw-yx/netlify-plugin-search-index) by [swyx](https://github.com/sw-yx) for fetching and parsing the content into something we can index, then split from the original version of [netlify-plugin-algolia-index](https://github.com/lukeocodes/netlify-plugin-algolia-index).

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