setNumericAttributesForFiltering method

AlgoliaQuery setNumericAttributesForFiltering({
  1. required List<String> value,
})

NumericAttributesForFiltering

List of numeric attributes that can be used as numerical filters.

By default, all numeric attributes are automatically indexed and available as numerical filters. For faster indexing, it is best to reduce the number of numeric attributes used for filtering. This setting enables you to do

Usage notes:

  • Acceptable values:
    • If a list of attributes is specified, only those attributes listed are available as numerical filters.
    • If you provide an empty list, no numerical filters are allowed.
    • If you specify the setting with null, then all numeric attributes are filterable. Use this to reset filtering back to all.

Modifiers

  • equalOnly: If you only need to filter on a numeric value based on equality (i.e. with the operators = or !=), you can use this modifier. All other operators will be disabled.

Source: Learn more

Implementation

AlgoliaQuery setNumericAttributesForFiltering({required List<String> value}) {
  assert(value.isNotEmpty, 'value can not be empty');
  assert(!_parameters.containsKey('numericAttributesForFiltering'));
  return _copyWithParameters(
      <String, dynamic>{'numericAttributesForFiltering': value});
}