Range Facet Fields Response Field

The rangeFacetFields field will be populated if if any range facet field counts were requested in the query. Each rangeFacetField contains the following 4 fields:

  • fieldName - the name of the field being faceted on
  • displayName - the human friendly name of the field being faceted on
  • removeCommand - command to remove this range facet field from the list of requested range facet fields
  • counts - list of the rangeFacetCount items for the individual ranges

Each rangeFacetCount contains the following 4 fields:

  • count - the document count
  • isApplied - whether or not there is a range filter already applied for this range
  • applyCommand - available if not isApplied - the command to apply a range filter for this range
  • removeCommand - available if isApplied - the command to remove the range filter for this range
  • range - the range being counted - contains a minValue and maxValue

The counts field is the only list on rangeFacetField, so there is no nested element for it.

Example - A rangeFacetFields element in XML format

<rangeFacetFields>
  <rangeFacetField
   fieldName="PublicationDate_dt"
   displayName="PublicationDate"
   removeCommand="removeFacetField(PublicationDate)">
    <rangeFacetCount
     count="44512"
     isApplied="true"
     removeCommand="removeRangeFilter(PublicationDate,1981:1990)">
      <range
       minValue="1981"
       maxValue="1990"/>
    </rangeFacetCount>
    <rangeFacetCount
     count="71826"
     isApplied="false"
     applyCommand="addRangeFilter(PublicationDate,1991:2000)">
      <range
       minValue="1991"
       maxValue="2000"/>
    </rangeFacetCount>
  </rangeFacetField>
</rangeFacetFields>

Example - A rangeFacetFields object in JSON format

"rangeFacetFields":[
  {
    "fieldName":"PublicationDate_dt",
    "displayName":"PublicationDate",
    "removeCommand":"removeFacetField(PublicationDate)",
    "counts":[
      {
        "range":{
          "minValue":"1981",
          "maxValue":"1990"
        },
        "count":45763,
        "isApplied":true,
        "removeCommand":"removeRangeFilter(PublicationDate,1981:1990)"
      },
      {
        "range":{
          "minValue":"1991",
          "maxValue":"2000"
        },
        "count":73459,
        "isApplied":false,
        "applyCommand":"addRangeFilter(PublicationDate,1991:2000)"
      }
    ]
  }
]