How to use the flexsearch/dist/flexsearch.min function in flexsearch

To help you get started, we’ve selected a few flexsearch 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 cinedantan / cinedantan / src / containers / SearchContainer.js View on Github external
import React, {useEffect, useState} from 'react';
import { connect } from 'react-redux';
import Slider from '../components/Slider'
import AnimSearch from '../components/AnimSearch'
import SearchBox from '../components/Search'
import Spacer from '../components/Spacer'
import SeoComponent from '../components/SeoComponent'
import { isMobile, imdbToMovie, idToPoster } from '../helpers'
import Share from '../components/Share'
import FlexSearch from 'flexsearch/dist/flexsearch.min'

var index = new FlexSearch({
  profile:"fast",
  async: true,
  cache: true
});

let isFired = false

function App({ movies, searchQ, route }) {
  const { match } = route
  const urlQuery = (match && match.params) ? match.params.q : null

  const [searchQuery, setSearchQuery] = useState(null)
  const [results, setResults] = useState([])

  useEffect(() => {
    if (!isFired) {

flexsearch

Next-Generation full text search library with zero dependencies.

Apache-2.0
Latest version published 10 months ago

Package Health Score

66 / 100
Full package analysis