open-index/open-npm huggingface dataset:
npm package: @searchkit/apollo-resolvers
Description: Elasticsearch GraphQL Resolvers for Apollo Server
Author: Joseph McElroy
Latest version: 3.0.0-canary.24

# <a href="https://searchkit.co/">Searchkit</a>

## Searchkit Apollo Resolvers

[![npm version](https://badge.fury.io/js/%40searchkit%2Fclient.svg)](https://badge.fury.io/js/%40searchkit%2Fclient)

Searchkit Apollo Resolvers is a library which allows you to build a Search API designed for Search UI experiences on top of Apollo Server. It integrates with Elasticsearch to provide search features like full-text search, faceted filtering and query highlighting.   

## Documentation

All Searchkit documentation can be found at: <br/>
[https://searchkit.co/docs/](https://searchkit.co/docs/)

The Searchkit Apollo Resolvers API reference can be found at: <br/>
[https://searchkit.co/docs/reference/apollo-resolvers](https://searchkit.co/docs/reference/apollo-resolvers)

### Quick Intro
From a configuration

```js
const searchkitConfig = {
  host: 'https://localhost:9200',
  index: 'movies',
  hits: {
    fields: [ 'title', 'plot', 'poster' ]
  },
  query: new MultiMatchQuery({ 
    fields: [ 'plot','title^4'] 
  }),
  facets: [
    new RefinementSelectFacet({ 
      field: 'type.raw',
      identifier: 'type',
      label: 'Type'
    }),
    new RefinementSelectFacet({
      field: 'writers.raw',
      identifier: 'writers',
      label: 'Writers',
      multipleSelect: true
    }),
    new RangeFacet({
      field: 'metaScore',
      identifier: 'metascore',
      label: 'Metascore',
      range: {
        min: 0,
        max: 100,
        interval: 5
      }
    }),
    new DateRangeFacet({
      field: 'released',
      identifier: 'released',
      label: 'Released'
    })
  ]
}
```

Will provide a GraphQL API where you can perform queries like:

#### Simple Hits
[Try it out](https://demo.searchkit.co/api/graphql)

```graphql
{
  results(query: "heat") {
    hits {
      items {
        id
        fields {
          title
        }
      }
    }
  }
}
```

#### Facets
[Try it out](https://demo.searchkit.co/api/graphql)

```graphql
{
  results(query: "heat") {
    facets {
      id
      label
      type
      display
      entries {
        id
        label
        count
      }
    }
    hits {
      items {
        id
        fields {
          title
        }
      }
    }
  }
}
```

#### Filtering
[Try it out](https://demo.searchkit.co/api/graphql)
```graphql
{
  results(filters: [{id: "type", value: "Movie"}, {id: "metascore", min: 30}]) {
    facets {
      identifier
      label
      type
      display
      entries {
        id
        label
        count
      }
    }
    hits {
      items {
        id
        fields {
          title
        }
      }
    }
  }
}
```

See [Schema Query Guide](https://searchkit.co/docs/guides/graphql-schema-queries-cheatsheet) for more examples.
npm package: @searchkit/cli
Description: Eases configuration and indexing of documents into elasticsearch
Author: Joseph McElroy
Latest version: 3.0.0

# <a href="https://www.searchkit.co/">Searchkit</a>

## Searchkit Cli

[![npm version](https://badge.fury.io/js/%40searchkit%2Felastic-ui.svg)](https://badge.fury.io/js/%40searchkit%2Fcli)

Eases configuration and indexing of documents into elasticsearch. Will provide a CLI to help you define your fields, add them as a mapping and index dataset into your local / cloud elasticsearch instance.

## Documentation

A Step guide on how to use searchkit CLI can be found at: <br/>
[https://searchkit.co/docs/guides/elasticsearch-setup-indexing](https://searchkit.co/docs/guides/elasticsearch-setup-indexing)

```javascript
withConfig({
  index: 'imdb_movies', <--- the elasticsearch index name
  host: "http://localhost:9200", <--- host url for elasticsearch
  source: movies, <---- Array of raw documents. Used with the field's sourceOptions. Optional
  type: 'movie' <----- required for Elasticsearch v6. If you use elasticsearch 7, do *not* specify type.
	fields: [
    {
      fieldName: 'type',  <-- name of field. Must be lowercase
      stored: true, <-------- fields you want returned in the API. 
      facet: true,  <-------- If you want the value to be used as a facet
      searchable: true <----- If you want the field to be searchable within query
      type: 'integer' <--- Optional. Default is keyword. Can be `integer`, `date` or `float`
      sourceOptions: { 
        path: 'Type' <-- Used in indexing step. The key for the field value source. 
        transform: splitComma <-- Optional. To provide transformation from source to document field 
      }
    }
  ]
})
```

Then run the CLI via `yarn start` and follow the steps.

#### Generate Example Searchkit Config?
If yes, CLI will generate a file in current working directory called skConfig.md. This will provide you an elasticsearch mapping file and an example searchkit config, based on the field definitions within config.ts

#### Host detected. Destroy index and reinsert index mapping?
If yes, will recreate the elasticsearch index

#### Source detected. Insert documents into ES host?
If yes, will index the documents into elasticsearch
npm package: @searchkit/client
Description: React Client for Searchkit. State management for search.
Author: Joseph McElroy
Latest version: 3.0.0

# <a href="https://www.searchkit.co/">Searchkit</a>

## Searchkit Client

[![npm version](https://badge.fury.io/js/%40searchkit%2Fclient.svg)](https://badge.fury.io/js/%40searchkit%2Fclient)

Searchkit Client is a client that manages search state (query, filters and pagination) and integrates with Apollo client & Searchkit API to provide search results. It allows you to easily build UI components with Searchkit's API.

## Documentation

All Searchkit Client documentation can be found at: <br/>
[https://searchkit.co/docs/](https://searchkit.co/docs/)

The Searchkit Client API reference can be found at: <br/>
[https://searchkit.co/docs/reference/searchkit-client](https://searchkit.co/docs/reference/searchkit-client/)