How to use the algoliasearch/lite function in algoliasearch

To help you get started, we’ve selected a few algoliasearch examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github algolia / docsearch / src / lib / DocSearch.js View on Github external
? autocompleteOptions.debug
        : false;
    // eslint-disable-next-line no-param-reassign
    autocompleteOptions.debug = debug || autocompleteOptionsDebug;
    this.autocompleteOptions = autocompleteOptions;
    this.autocompleteOptions.cssClasses =
      this.autocompleteOptions.cssClasses || {};
    this.autocompleteOptions.cssClasses.prefix =
      this.autocompleteOptions.cssClasses.prefix || 'ds';

    // eslint-disable-next-line no-param-reassign
    handleSelected = handleSelected || this.handleSelected;

    this.isSimpleLayout = layout === 'simple';

    this.client = algoliasearch(this.appId, this.apiKey);
    this.client.addAlgoliaAgent(`docsearch.js ${version}`);

    if (enhancedSearchInput) {
      this.input = DocSearch.injectSearchBox(this.input);
    }

    this.autocomplete = autocomplete(this.input, autocompleteOptions, [
      {
        source: this.getAutocompleteSource(transformData, queryHook),
        templates: {
          suggestion: DocSearch.getSuggestionTemplate(this.isSimpleLayout),
          footer: templates.footer,
          empty: DocSearch.getEmptyTemplate(),
        },
      },
    ]);
github algolia / doc-code-samples / Vue InstantSearch / algolia-insights / src / App.vue View on Github external
data() {
    return {
      searchClient: algoliasearch(
        'latency',
        '6be0576ff61c053d5f9a3225e2a90f76'
      ),
    };
  },
  methods: {
github algolia / doc-code-samples / Angular InstantSearch / routing-basic / src / app / app.component.ts View on Github external
import { Component } from '@angular/core';
import algoliasearch from "algoliasearch/lite";

const searchClient = algoliasearch(
  "B1G2GM9NG0",
  "aadef574be1f9252bb48d4ea09b5cfe5"
);

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  config = {
    indexName: 'demo_ecommerce',
    searchClient,
    routing: true
  };
}
github pmt-mcpe-fun / website / components / PoggitSearch.jsx View on Github external
render = () => {
    const searchClient = algoliasearch(
      'XI77W278IB',
      'cf3b496f36aefb12a0a875810c234554',
    );

    return (
      <>
        
          
          <content></content>
          
        
      
    );
github algolia / react-instantsearch / examples / geo-search / src / App.js View on Github external
import qs from 'qs';
import React, { Component, Fragment } from 'react';
import algoliasearch from 'algoliasearch/lite';
import { InstantSearch, SearchBox, Configure } from 'react-instantsearch-dom';
import {
  GoogleMapsLoader,
  GeoSearch,
  Control,
  Marker,
} from 'react-instantsearch-dom-maps';

const searchClient = algoliasearch(
  'latency',
  '6be0576ff61c053d5f9a3225e2a90f76',
  {
    _useRequestCache: true,
  }
);

const updateAfter = 700;
const searchStateToUrl = searchState =>
  searchState ? `${window.location.pathname}?${qs.stringify(searchState)}` : '';

class App extends Component {
  constructor() {
    super();

    this.state = {
github algolia / doc-code-samples / Vue InstantSearch / routing-state-mapping / src / App.vue View on Github external
data() {
    return {
      searchClient: algoliasearch(
        'B1G2GM9NG0',
        'aadef574be1f9252bb48d4ea09b5cfe5'
      ),
      routing: {
        router: historyRouter(),
        stateMapping: {
          stateToRoute(uiState) {
            return {
              query: uiState.query,
              brands:
                uiState.refinementList &&
                uiState.refinementList.brand &&
                uiState.refinementList.brand.join('~'),
              page: uiState.page,
            };
          },
github kidonng / scoop-docs / docs / .vuepress / utils / search.js View on Github external
import algoliasearch from 'algoliasearch/lite'
import { history } from 'instantsearch.js/es/lib/routers'
import { simple } from 'instantsearch.js/es/lib/stateMappings'
import 'instantsearch.css/themes/algolia-min.css'

export default {
  indexName: 'scoop_apps',
  searchClient: algoliasearch('F8ONSWSRN9', '134a8d4dd5935708368241431ab745c3'),
  routing: {
    router: history(),
    stateMapping: simple()
  }
}
github janosh / janosh.io / src / components / Search / index.js View on Github external
  const searchClient = useMemo(() => algoliasearch(appId, searchKey), [
    appId,
github algolia / react-instantsearch / stories / RefreshCache.stories.js View on Github external
import React, { Component } from 'react';
import { storiesOf } from '@storybook/react';
import algoliasearch from 'algoliasearch/lite';
import { InstantSearch, SearchBox, Configure } from 'react-instantsearch-dom';
import { CustomHits } from './util';

const stories = storiesOf('RefreshCache', module);

const searchClient = algoliasearch(
  'latency',
  '6be0576ff61c053d5f9a3225e2a90f76'
);

class AppWithRefresh extends Component {
  state = {
    refresh: false,
  };

  refresh = () => {
    this.setState({ refresh: true }, () => {
      this.setState({ refresh: false });
    });
  };

  render() {
github algolia / react-instantsearch / examples / default-theme / App.js View on Github external
SortBy,
  Stats,
  Pagination,
  Panel,
  ClearRefinements,
  RatingMenu,
  RangeInput,
  Highlight,
  Configure,
  connectStateResults,
} from 'react-instantsearch-dom';
import algoliasearch from 'algoliasearch/lite';
import withURLSync from './URLSync';
import './App.css';

const searchClient = algoliasearch(
  'latency',
  '6be0576ff61c053d5f9a3225e2a90f76'
);

const App = props =&gt; (
  
    
    <header>
    <div>
      </div></header>

algoliasearch

A fully-featured and blazing-fast JavaScript API client to interact with Algolia API.

MIT
Latest version published 6 days ago

Package Health Score

85 / 100
Full package analysis