Skip to main content
  • Type: list<string>
  • Default: []
  • Scope: search
In most cases, prefer using the filters parameter, which offers a simpler SQL-like syntax and supports combining numeric, facet, and tag filters. However, sometimes you might want to combine filters and numericFilters in the same search.

Usage

  • You can’t use boolean operators (AND, OR, NOT) inside numericFilters.
  • Multiple filters in a flat array are combined using AND. To combine filters with OR, use nested arrays.
  • Filters support numeric values from -4611686018427387 to +4611686018427387.
  • Numeric precision is limited to three decimal places.

Numeric comparisons

  • Syntax: facet <operator> value
  • Operators: <, <=, =, !=, >=, >.
  • Example: inStock = 1

Numeric ranges

  • Format: facet:low TO high
  • Example: price:5.99 TO 100
  • Both bounds must be numeric.
  • Ranges are inclusive.

Combining with filters

You can combine filters and numericFilters. For example:
JavaScript
index.search("", {
  filters: '("county:Maricopa" OR "county:Pima")',
  numericFilters: ["employees > 500"],
});
This returns results with more than 500 employees and the county is either Maricopa or Pima.

Example

Current API clients

var response = await client.SearchSingleIndexAsync<Hit>(
  "ALGOLIA_INDEX_NAME",
  new SearchParams(
    new SearchParamsObject
    {
      Query = "query",
      NumericFilters = new NumericFilters(
        new List<NumericFilters>
        {
          new NumericFilters("price < 1000"),
          new NumericFilters(
            new List<NumericFilters>
            {
              new NumericFilters("inStock = 1"),
              new NumericFilters("deliveryDate < 1441755506"),
            }
          ),
        }
      ),
    }
  )
);
index.Search(new Query("query")
{
    NumericFilters = new List>
    {
      new List { "inStock = 1", "deliveryDate < 1441755506"  },
      new List { "price < 1000" }
    };
});
I