--- title: Coveo Distance Sort slug: '3063' canonical_url: https://docs.coveo.com/en/3063/ collection: coveo-for-sitecore-v5 source_format: adoc --- # Coveo Distance Sort > **Legacy feature** > > The Coveo Hive Framework is now in maintenance mode and is no longer recommended for new implementations. > > To build new search experiences, use one of Coveo's more modern, lightweight, and responsive libraries. > To get started, see the [Build search](https://docs.coveo.com/en/2473/) article. Implements the [Coveo JavaScript Search Framework](https://docs.coveo.com/en/187/) [Sort](https://coveo.github.io/search-ui/components/sort.html) component with the `sortCriteria` component option set to `@ ascending`. Clicking the **Coveo Distance Sort** search interface control allows the user to switch to search result sorting based on distance, with items nearest to the user appearing first. ## Usage notes * To use the **Coveo Distance Sort** rendering, you first need to add the [Coveo Distance Resources](https://docs.coveo.com/en/2272/) rendering and a [Position Providers](https://docs.coveo.com/en/2999/) rendering to automatically calculate the user-item distance and store it in the `Distance sort field`. * When a user changes the search results sorting option by clicking another Coveo Sort search interface control, this triggers a Search API call with the requested `sortCriteria` in the query parameters. * You can [customize the CSS](https://docs.coveo.com/en/2342/) associated with this rendering. ## Insertion location

Coveo Hive

The Coveo Distance Sort rendering is an Allowed Control in the following placeholder(s): Sorts

Example insertion sequence for the Coveo Distance Sort rendering.

Coveo Hive SXA

Coveo for Sitecore SXA rendering insertion locations aren't limited by placeholder Allowed Controls. The Coveo Distance Sort rendering may therefore be inserted throughout the partial design, whether in Coveo for Sitecore or Sitecore placeholders.

Example insertion sequence for the Coveo Distance Sort rendering.
## Data source options The following table lists the available data source options for this rendering. [%header,cols="33%,66%"] |=== |Option name |Description |Caption |See the [caption](https://coveo.github.io/search-ui/components/sort.html#options.caption) component option. |Distance sort field |See the [sortCriteria](https://coveo.github.io/search-ui/components/sort.html#options.sortcriteria) component option. |DOM unique ID a|{empty} -- Randomly generated HTML element ID. -- |Additional data attributes a|{empty} -- Allows [use of the Coveo JavaScript Search Framework **Sort** component options](https://docs.coveo.com/en/2776/) that aren't directly available in the data source. -- |=== ## Sample generated HTML and corresponding visual output ```html
Store Distance Disabled. Please configure the distance resources component.
``` ![Distance Sort example | Coveo for Sitecore 5](https://docs.coveo.com/en/assets/images/c4sc-v5/distance-sort-example.gif)