Skip to main content
This information relates to the ‘Highlight’ response field, which is returned when making a Capture Find or Geocoding Typeahead API call.
The ‘Highlight’ field provides a list of number ranges showing which characters in the Text and Description fields match the user’s search term. This can be used to determine which characters should be highlighted in bold in the search field, to give the user a visual representation of what’s being searched.
If a Container Id is included in a Capture Find request, Highlight will be empty. It will be populated for any other request.

Considerations

  • Highlight ranges are expressed as ‘X-Y’ where highlighting should start from character position X and go up to but not including character position Y
  • Characters start from position 0
  • Commas separate numbers within a single field, while a semicolon separates numbers in Text from numbers in Description
  • Spaces are counted as characters
  • If no characters in Text should be highlighted, the string will start with a semicolon

Example

Take this example:
"Highlight": "0-4, 7; 1-4",
This indicates that characters 0, 1, 2, 3 and 7 in the Text field should be highlighted, and also characters 1, 2 and 3 in the Description field.
I