All Projects → searchkit → Searchkit

searchkit / Searchkit

Licence: other
GraphQL API & React UI components for Elasticsearch. The easiest way to build a great search experience

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Searchkit

Guide
📖 The GraphQL Guide website
Stars: ✭ 104 (-97.6%)
Mutual labels:  graphql, apollo, apollo-client
React Redux Graphql Apollo Bootstrap Webpack Starter
react js + redux + graphQL + Apollo + react router + hot reload + devTools + bootstrap + webpack starter
Stars: ✭ 127 (-97.07%)
Mutual labels:  graphql, apollo, apollo-client
Apollo Link
🔗 Interface for fetching and modifying control flow of GraphQL requests
Stars: ✭ 1,434 (-66.94%)
Mutual labels:  graphql, apollo, apollo-client
Apollo Cache Hermes
A cache implementation for Apollo Client, tuned for performance
Stars: ✭ 425 (-90.2%)
Mutual labels:  graphql, apollo, apollo-client
Countries
🌎 Public GraphQL API for information about countries
Stars: ✭ 156 (-96.4%)
Mutual labels:  graphql, apollo, graphql-api
Apollo Upload Client
A terminating Apollo Link for Apollo Client that allows FileList, File, Blob or ReactNativeFile instances within query or mutation variables and sends GraphQL multipart requests.
Stars: ✭ 1,176 (-72.89%)
Mutual labels:  graphql, apollo, apollo-client
Awesome Apollo Graphql
A curated list of amazingly awesome things regarding Apollo GraphQL ecosystem 🌟
Stars: ✭ 126 (-97.1%)
Mutual labels:  graphql, apollo, apollo-client
Guide To Graphql
A Frontend Developer's Guide to GraphQL (Fluent Conf 2018)
Stars: ✭ 59 (-98.64%)
Mutual labels:  graphql, apollo, apollo-client
Next Graphql Blog
🖊 A Blog including a server and a client. Server is built with Node, Express & a customized GraphQL-yoga server. Client is built with React, Next js & Apollo client.
Stars: ✭ 152 (-96.5%)
Mutual labels:  graphql, apollo, apollo-client
Reactql
Universal React+GraphQL starter kit: React 16, Apollo 2, MobX, Emotion, Webpack 4, GraphQL Code Generator, React Router 4, PostCSS, SSR
Stars: ✭ 1,833 (-57.75%)
Mutual labels:  graphql, apollo, apollo-client
Villus
🏎 A tiny and fast GraphQL client for Vue.js
Stars: ✭ 378 (-91.29%)
Mutual labels:  graphql, apollo, graphql-api
Apollo Cache Redux
Redux cache for Apollo Client 2.0. This project is no longer maintained.
Stars: ✭ 179 (-95.87%)
Mutual labels:  graphql, apollo, apollo-client
Artemis Dev Tool
An Apollo GraphQL Query Schema Testing Tool
Stars: ✭ 66 (-98.48%)
Mutual labels:  graphql, apollo, apollo-client
Apollo
Meteor & Apollo integration
Stars: ✭ 87 (-97.99%)
Mutual labels:  graphql, apollo, graphql-api
Cynthesize Frontend
Frontend written in Angular 7 and deployed GraphQL for Cynthesize. Development build: https://cynthesize-develop.netlify.com
Stars: ✭ 65 (-98.5%)
Mutual labels:  graphql, apollo, apollo-client
React Graphql Github Apollo
🚀 A React + Apollo + GraphQL GitHub Client. Your opportunity to learn about these technologies in a real world application.
Stars: ✭ 1,563 (-63.97%)
Mutual labels:  graphql, apollo, apollo-client
A Pop
🎶 HD Music Streaming and Sharing Web App
Stars: ✭ 55 (-98.73%)
Mutual labels:  graphql, apollo, apollo-client
Blaze Apollo
Blaze integration for the Apollo Client
Stars: ✭ 56 (-98.71%)
Mutual labels:  graphql, apollo, apollo-client
Graphql Directive
Use custom directives in your GraphQL schema and queries 🎩
Stars: ✭ 142 (-96.73%)
Mutual labels:  graphql, apollo, apollo-client
React Apollo Form
Build React forms based on GraphQL APIs.
Stars: ✭ 178 (-95.9%)
Mutual labels:  graphql, apollo, graphql-api

Search, made easy

Searchkit is an open source toolkit which helps you build a great search experience with Elasticsearch.

Searchkit is a Graph QL / React UI Component framework to:

  • Quickly build a GraphQL API focused on search UI
  • Out-of-the-box React components
  • A great Search experience without needing to be an expert in Elasticsearch, React and Node

Highlights

api-setup-2

Read our blog post about Searchkit V3

Release History

  • 3.0.0-canary.46 : Debug mode for logging elasticsearch query. Activated via ENV variable DEBUG_MODE=true. view release nodes
  • 3.0.0-canary.44 : Out the box filters for terms and ranges view release nodes
  • 3.0.0-canary.41 : Hierarchical Facet support. Breaking change with facet entries GQLView release notes
  • 3.0.0-canary.39 : Facet Visibility rules allowing you to show / hide facets depending on search state View Release notes
  • 3.0.0-canary.37 : Fixes for routing HOC used for Next _app layout component View Release notes

Searchkit Classic

For those who currently use Searchkit Classic, here are quicklinks to codebase & Docs

Quick Intro

From a configuration

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

const { typeDefs, withSearchkitResolvers, context } = SearchkitSchema({
  config: searchkitConfig,
  typeName: 'ResultSet', 
  hitTypeName: 'ResultHit',
  addToQueryType: true 
})

const server = new ApolloServer({
  typeDefs: [
    gql`
    type Query {
      root: String
    }

    type HitFields {
      title: String
    }

    type ResultHit implements SKHit {
      id: ID!
      fields: HitFields
    }
  `, ...typeDefs
  ],
  resolvers: withSearchkitResolvers({}),
  introspection: true,
  playground: true,
  context: {
    ...context
  }
})

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

Simple Hits

Try it out

{
  results(query: "heat") {
    hits {
      items {
        ... on ResultHit {
          id
          fields {
            title
          }
        }
      }
    }
  }
}

Facets

Try it out

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

Filtering

Try it out

{
  results(filters: [{identifier: "type", value: "Movie"}, {identifier: "metascore", min: 30}]) {
    summary {
      appliedFilters {
        identifier
        id
        label
        display
        ... on ValueSelectedFilter {
          value
        }
      }
    }
    facets {
      identifier
      label
      type
      display
      entries {
        id
        label
        count
      }
    }
    hits {
      items {
        ... on ResultHit {
          id
          fields {
            title
          }
        }
      }
    }
  }
}

See Schema Query Guide for more examples.

React Integration

We provide a thin React client which integrates with Searchkit's API, Apollo Client. It maintains search state (pagination, filtering and querying) and calls Apollo client to fetch.

React Components

import {
  FacetsList,
  SearchBar,
  Pagination,
  ResetSearchButton,
  SelectedFilters
} from '@searchkit/elastic-ui'

const Page = () => {
  const variables = useSearchkitVariables()
  const { data, loading } = useQuery(query, { variables })
  const [viewType, setViewType] = useState('list')
  const Facets = FacetsList([])
  return (
    <EuiPage>
      <EuiPageSideBar>
        <SearchBar loading={loading} />
        <EuiHorizontalRule margin="m" />
        <Facets data={data?.results} loading={loading} />
      </EuiPageSideBar>
      <EuiPageBody component="div">
        <EuiPageHeader>
          <EuiPageHeaderSection>
            <EuiTitle size="l">
              <SelectedFilters data={data?.results} loading={loading} />
            </EuiTitle>
          </EuiPageHeaderSection>
          <EuiPageHeaderSection>
            <ResetSearchButton loading={loading} />
          </EuiPageHeaderSection>
        </EuiPageHeader>
        <EuiPageContent>
          <EuiPageContentHeader>
            <EuiPageContentHeaderSection>
              <EuiTitle size="s">
                <h2>{data?.results.summary.total} Results</h2>
              </EuiTitle>
            </EuiPageContentHeaderSection>
            <EuiPageContentHeaderSection>
              <EuiButtonGroup
                options={[
                  {
                    id: `grid`,
                    label: 'Grid'
                  },
                  {
                    id: `list`,
                    label: 'List'
                  }
                ]}
                idSelected={viewType}
                onChange={(id) => setViewType(id)}
              />
            </EuiPageContentHeaderSection>
          </EuiPageContentHeader>
          <EuiPageContentBody>
            {viewType === 'grid' ? <HitsGrid data={data} /> : <HitsList data={data} />}
            <EuiFlexGroup justifyContent="spaceAround">
              <Pagination data={data?.results} />
            </EuiFlexGroup>
          </EuiPageContentBody>
        </EuiPageContent>
      </EuiPageBody>
    </EuiPage>
  )
}

See quickstart guide

Example Projects

  • Next App with Searchkit & Elastic UI Code | Demo

NPM Packages

Sponsors

QBOX Elasticsearch hosting. They have kindly provided us an elasticsearch instance for our demo site.

FAQ

Can I upgrade from Searchkit v2?

Searchkit has undergone a total rewrite so whilst it should be straightforward to move onto, any code written for searchkit legacy wouldn't work on Searchkit v3.

Do I need to expose my Elasticsearch instance to the browser?

No! You dont expose your elasticsearch cluster to the browser, Search API sits in between elasticsearch and the browser.

I'm building a Native App / use angular. Do I need to use the Searchkit UI components?

No! Searchkit API provides a dev friendly search API. Searchkit simplifies using elasticsearch for search so that you can build your own UI components very easily. If your apps dont use react or you are building a native mobile app, you can just use the searchkit API. See our blog article for more information

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].