CORE APIS

Sorting

Words like "cheapest", "newest" or "highest floor" become sort hints next to the filters.

The sort array

sort is always present, empty when the words ask for no order. Each entry is { field, direction } with its evidence, in the order asked. A sort never replaces a filter: "cheapest 2 bed under 90k" gives the bedroom and price filters and a price sort.

JSON
[
  {
    "field": "year_built",
    "direction": "desc",
    "source": "lexicon",
    "confidence": 1,
    "evidence": [
      {
        "start": 0,
        "end": 6
      }
    ]
  }
]

Sortable fields

bedrooms, bathrooms, parking_spaces, rent_cheques, area_floor, area_plot, floor_level, year_built, price, availability_date, price_per_sqft, down_payment, handover_date, completion_percentage, payment_plan_years, listed_at.

When a sort cannot be used

CodeWhen
SORT_NEGATED"not the cheapest"
SORT_CONFLICTTwo opposite orders for one field
SORT_UNSUPPORTEDAn order on something that cannot be sorted

These come back in unresolved. Index search takes sort unchanged; price sorts compare rents per year.