meilisearch-swift
meilisearch-swift copied to clipboard
Support Match Positions and Formatted Response in Search Queries
trafficstars
-
When
showMatchesPositionis true,matchPositionsshould be defined on the returned document- All fields (even those not in
searchableAttributes) may have locations - Swift API should utilise an optional dynamic member lookup or key path subscript based on document members (so,
hit[0].matchPositions.title?.countwhere title is a member on the document). This is to allow for compiler-safe access to attributes. - Match positions is an array of objects, each object contains a "start" and "length" both integers measured in bytes and not the number of characters.
- All fields (even those not in
-
When
attributesToHighlightis not empty,formattedDocumentshould be defined- This will be an instance of
T(the document itself), but values may be changed based on search inputs
- This will be an instance of
Solution is reliant on #413 being merged to avoid additional breaking changes.