How to use the searchkit.RangeQuery 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-e2e-tests / src / apps / playground / index.tsx View on Github external
              
              
               (
                  
                        <option value="list">List</option>
                        <option value="checkbox">Checkbox</option>
                        <option value="histogram">Histogram</option>
                        <option value="select">Select</option>
                        <option value="tabs">Tabs</option>
                        <option value="tags">TagCloud</option>
github assembl / assembl / assembl / static2 / js / app / components / search.jsx View on Github external
title={I18n.t('search.Creative participants')}
                    label={I18n.t('search.Creative participants')}
                    filter={HasChildQuery(
                      'post',
                      BoolMust([TermQuery('discussion_id', discussionId), TermQuery('parent_id', 0)])
                    )}
                  /&gt;
github CRUKorg / cruk-searchkit / src / components / search / date / CRUKSearchkitDateRangeAccessor.jsx View on Github external
buildSharedQuery(query) {
    if (this.state.hasValue()) {
      let val = this.state.getValue();
      this.options.updateParentState(val.min, val.max);
      let rangeFilter = RangeQuery(this.options.field, {
        gte: val.min,
        lt: this.addOneDay(val.max),
        format: 'yyyy-MM-dd'
      });

      let selectedFilter = {
        name:this.translate(this.options.title),
        value:`${val.min} - ${val.max}`,
        id:this.options.id,
        remove:()=> {
          this.state = this.state.clear()
        }
      };

      return query
        .addFilter(this.key, rangeFilter)
github searchkit / searchkit-demo / src / app / src / playground / accessors / NumericOptionsAccessor.ts View on Github external
    var filterRanges = map(filters, filter =&gt; RangeQuery(this.options.field, {
      gte: filter.from, lt: filter.to
    }))
    var selectedFilters: Array = map(filters, (filter) =&gt; {
github mitodl / micromasters / static / js / components / search / FinalGradeRangeFilter.js View on Github external
createQueryFilter(appliedFilterValue) {
    return RangeQuery(this.options.field, {
      gte: appliedFilterValue.min,
      lte: appliedFilterValue.max
    })
  }
github searchkit / searchkit-demo / src / app / src / playground / PlaygroundApp.tsx View on Github external
<div>

            <div>
              {/*<button>Click to refresh</button>*/}
              
                
              
              
              
              
              
              
              
              
              
                
              
              
              </div></div>
github CRUKorg / cruk-searchkit / src / components / search / date / CRUKSearchkitDateRangeAccessor.jsx View on Github external
buildOwnQuery(query) {
    const val = this.state.getValue();
    const min = val.min;
    const max = val.max;

    let otherFilters = query.getFiltersWithoutKeys(this.key);
    let filters = BoolMust([
      otherFilters,
      RangeQuery(this.options.field,{
        gte:min,
        lt: this.addOneDay(val.max),
        format: 'yyyy-MM-dd'
      })
    ]);

    const metric = CardinalityMetric(this.key, this.options.field);

    return query.setAggs(FilterBucket(
      this.key,
      filters,
      metric
    ));
  }
}