# Range


# Description

A range is a type of index that can be queried within a boundary of numbers. Therefore, a range must be a numerical data type. For example, a 1search implementation that sells items might use a "Price" range for which users can specify a minimum and maximum price that they would like their search results to lie within.

Any range you wish to add to your 1search implementation must be specified within a <Ranges> tag.

You can also define histogram which is built on range index. A histogram can be used to return the number of items that fall within certain value intervals of the range index. For more information on how to configure a Histogram in 1search, see Histograms.

# Syntax

<Ranges>
    <Range Name="string" DataType="string" Key="string"/>
</Ranges>

# Attributes

Note: attributes marked with * are required.

  • Name* (string) :
    • The name of the string. This value must be unique across all other range indexes defined.
  • DataType* ("System.Int32", "System.Int64", "System.Double", "System.Decimal" or "System.DateTime") :
    • The data type of your range index.
  • Key* (string) :
    • The unique identifier of your range index. This value must be unique among all other index keys.
  • Func* (string) Replaces Key:
    • Key can be replaced with a Func if a plain JSON path is not enough.