Skip to main content

Results ordering and sorting levels

Sort results by any field including name or custom fields

Written by Bryan Nye
Updated over a month ago

MetaLocator allows for sorting data in your search results.  By default, search results are ordered by the distance from a user's search.  However, outside the presence of a geographic search term you can control the primary ordering of the results.  When a geographic search is performed results are presented ordered by Distance first.  This assumes the search is not configured to prioritize certain groups of results.

If not otherwise specified, the data is presented in the order in which it was imported into MetaLocator.  This is the default.  To add a level of sorting, click Filter & Sort, then scroll down to Field Sorting as shown below.

Click Add Sorter to add a sorting level.  Choose a field and a direction.  Add additional sorting levels as needed. Be sure to Save your interface to see the changes.

Adding Weighted Sorting

MetaLocator supports weighted sorting in the Field Sorter control of the Interface Builder. This feature allows administrators to assign an optional percentage weight (between 1 and 100) to each sort clause. This influences the contribution of each sort field to the overall order of search results.

Weighted sorting values can only be applied to numeric field types.

Enabling Weighted Sorting

  1. Access the Field Sorter Control:

    1. Navigate to the Interface Builder and open the Field Sorter control.

  2. Add Weight to Sort Clauses:

    1. For each sort clause, locate the new Weight (%) input.

    2. Enter a numeric value between 1 and 100 to define the weight. This value determines the influence of the clause in sorting.

  3. Save and Validate:

    1. Ensure all weight values are numeric and within the permissible range. Invalid entries will display a validation error.

    2. Save your configuration. The weight settings will persist and reload correctly when editing the interface.

Randomizing Results

In cases where your locations are competing entities, like dealers or sales agents, you want to ensure your directory is not biased towards a given database entry. Random ordering allows you to mix up your search results each time they are displayed.

To add randomization to the results list, click Filter & Sort then select 20 More Filter & Sort Features. Sort Randomly will need to be toggled to Yes and the interface can then be saved.

Did this answer your question?