Skip to content

Commit

Permalink
Merge branch 'master' of github.com:wreally/gatsby-plugin-typesense i…
Browse files Browse the repository at this point in the history
…nto master
  • Loading branch information
jasonbosco committed Oct 25, 2020
2 parents b0b085e + eab90b6 commit 3ed8f17
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# gatsby-plugin-typesense [![NPM version][npm-image]][npm-url] [![CircleCI](https://circleci.com/gh/typesense/gatsby-plugin-typesense.svg?style=shield)](https://circleci.com/gh/typesense/gatsby-plugin-typesense)

Plugin to build typo-tolerant Instant Search experiences on [Gatsby](https://www.gatsbyjs.com/)-powered sites using [Typesense](http://typesense.org/).
A Gatsby plugin to build typo-tolerant Instant Search experiences on [Gatsby](https://www.gatsbyjs.com/)-powered sites using [Typesense](http://typesense.org/).

This plugin runs post-build and indexes content from your site to Typesense. The search UI is then built with the [Typesense-InstantSearch.js](https://github.com/typesense/typesense-instantsearch-adapter) library.

This plugin works for both static and dynamic Gatsby sites. It does not depend on you using Markdown, Frontmatter, or any particular Gatsby plugin. It does not even depend on React. So you can use it with really any type of Gatsby site.

#### What is Typesense?

If you're new to Typesense, it is an **open source** search engine that is simple to use, run and scale, with clean APIs and documentation. Think of it as an open source alternative to Algolia and an easier-to-use, batteries-included alternative to ElasticSearch. Get a quick overview from [this guide](https://typesense.org/guide/).
Expand Down Expand Up @@ -130,7 +132,7 @@ module.exports = {
}
```

Here's what the options mean:
#### Here's what the options mean:

##### `publicDir`

Expand Down Expand Up @@ -209,9 +211,15 @@ This will index your content to your Typesense search cluster.

The good folks over at Algolia have built and open-sourced [Instantsearch.js](https://github.com/algolia/instantsearch.js) which is a powerful collection of out-of-the-box UI components that you can use to compose interactive search experiences quickly.

Typesense has an integration with InstantSearch.js (and its [React](https://github.com/algolia/react-instantsearch), [Vue](https://github.com/algolia/vue-instantsearch) and [Angular](https://github.com/algolia/angular-instantsearch) cousins), that lets you use a Typesense cluster with InstantSearch.js.
Typesense has an integration with InstantSearch.js (and its [React cousin](https://github.com/algolia/react-instantsearch)), that lets you use a Typesense cluster with InstantSearch.js.

Install InstantSearch and the Typesense Adapter in your Gatsby project:

```bash
npm install typesense-instantsearch-adapter react-instantsearch-dom @babel/runtime
```

Here's a quick minimal example of a search interface using react-instantsearch:
Here's a quick minimal example of a search interface:

```jsx
import { InstantSearch, SearchBox, Hits, Stats } from "react-instantsearch-dom"
Expand Down Expand Up @@ -254,7 +262,9 @@ export default function SearchInterface() {
}
```

Read more on how to use the adapter and build search interfaces [here](https://github.com/typesense/typesense-instantsearch-adapter#quick-start).
InstantSearch.js supports a variety of additional [search widgets](https://www.algolia.com/doc/guides/building-search-ui/widgets/showcase/react/). Read more about how to use them in their documentation [here](https://www.algolia.com/doc/guides/building-search-ui/getting-started/react/).

Read more on how to use the Typesense adapter [here](https://github.com/typesense/typesense-instantsearch-adapter#quick-start).

## 🏗️ Local Development Workflow

Expand Down

0 comments on commit 3ed8f17

Please sign in to comment.