How to use the searchkit.FacetAccessor function in searchkit

To help you get started, we’ve selected a few searchkit 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 searchkit / searchkit / packages / searchkit-autosuggest / src / datasources / FacetFilterDatasource.ts View on Github external
configure(searchkit) {
        this.searchkit = searchkit
        if (this.options.accessorId) {
            let accessor = searchkit.accessors.statefulAccessors[this.options.accessorId]
            if (!accessor) {
                console.error(`Could not create facet filter datasource with accessorId=${this.options.accessorId}`)
            } else {
                this.originalAccessor = accessor
            }
        } else {
            let { id, field, operator, fieldOptions, title, size } = this.options
            this.originalAccessor = new FacetAccessor(id, {
                id, field, operator, fieldOptions, title, size
            })
            this.searchkit.addAccessor(this.originalAccessor)
        }
        this.delegateAccessor = this.createDelegate(this.originalAccessor)

    }
github searchkit / searchkit-examples / searchkit-starter-react16 / src / components / SearchkitAutosuggest / datasources / FacetFilterDatasource.js View on Github external
configure(searchkit) {
        this.searchkit = searchkit
        if (this.options.accessorId) {
            let accessor = searchkit.accessors.statefulAccessors[this.options.accessorId]
            if (!accessor) {
                console.error(`Could not create facet filter datasource with accessorId=${this.options.accessorId}`)
            } else {
                this.originalAccessor = accessor
            }
        } else {
            let { id, field, operator, fieldOptions, title } = this.options
            this.originalAccessor = new FacetAccessor(id, {
                id, field, operator, fieldOptions, title
            })
            this.searchkit.addAccessor(this.originalAccessor)
        }
        this.delegateAccessor = this.createDelegate(this.originalAccessor)

    }
github searchkit / searchkit / packages / searchkit-autosuggest / src / datasources / FacetFilterDatasource.ts View on Github external
createDelegate(accessor) {
        let delegateAccessor = new FacetAccessor(accessor.options.id, { ...accessor.options })
        delegateAccessor.uuid = accessor.options.id
        return delegateAccessor
    }
github searchkit / searchkit-examples / searchkit-starter-react16 / src / components / SearchkitAutosuggest / datasources / FacetFilterDatasource.js View on Github external
createDelegate(accessor) {
        let delegateAccessor = new FacetAccessor(accessor.options.id, { ...accessor.options })
        delegateAccessor.uuid = accessor.options.id
        return delegateAccessor
    }
github searchkit / searchkit-demo / src / app / src / playground / MultiSelectFilter / MultiSelectFilter.tsx View on Github external
defineAccessor() {
    const { field, id, operator, title, size, translations } = this.props;
    return new FacetAccessor(field, {
      id, operator, title, size, translations
    })
  }
github searchkit / searchkit-demo / src / app / src / playground / components / MenuFilter.tsx View on Github external
defineAccessor() {
    const {
      field, id, size, title,
      include, exclude, orderKey, orderDirection
    } = this.props
    const operator = "OR"
    return new FacetAccessor(field, {
      id, operator, title, size, orderKey, orderDirection,
      include, exclude
    })
  }
github searchkit / searchkit-demo / src / app / src / playground / components / RefinementListFilter.tsx View on Github external
defineAccessor() {
    const {
      field, id, operator, title, include, exclude,
      size, translations, orderKey, orderDirection
    } = this.props
    return new FacetAccessor(field, {
      id, operator, title, size, include, exclude,
      translations, orderKey, orderDirection
    })
  }