How to use the searchkit.ImmutableQuery 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-examples / searchkit-starter-react16 / src / components / RefinementFilterSuggest / RefinementSuggestAccessor.js View on Github external
async search(query){
        let sharedQuery = this.searchkit.accessors.buildSharedQuery(new ImmutableQuery())
        this.options.include = this.createRegexQuery(query)
        let searchQuery = super.buildOwnQuery(sharedQuery)
            .setSize(0)        

        let results = await this.searchkit.transport.search(
            searchQuery.getJSON())    
        
        return get(results, [
            "aggregations", this.uuid, this.options.field, "buckets"
        ], [])        
    }
}
github searchkit / searchkit / packages / searchkit-refinement-autosuggest / src / RefinementAutosuggestAccessor.ts View on Github external
async search(query) {
        let sharedQuery = this.searchkit.accessors.buildSharedQuery(new ImmutableQuery())
        this.options.include = createRegexQuery(query)
        let searchQuery = super.buildOwnQuery(sharedQuery)
            .setSize(0)

        let results = await this.searchkit.transport.search(
            searchQuery.getJSON())

        return get(results, [
            "aggregations", this.uuid, this.options.field, "buckets"
        ], [])
    }
}
github searchkit / searchkit / packages / searchkit-autosuggest / src / datasources / SearchkitDatasourceManager.ts View on Github external
async search(query = "") {
        let sharedQuery = new ImmutableQuery()
            .setSize(0)
        let searchQuery = reduce(this.sources, (searchQuery, source) => {
            return source.search(searchQuery, query)
        }, sharedQuery)
        this.results = await this.transport.search(searchQuery.getJSON())
        return this.getGroupedResults()
    }