Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Match Positions and Formatted Response in Search Queries #419

Open
Sherlouk opened this issue Sep 24, 2023 · 0 comments
Open

Support Match Positions and Formatted Response in Search Queries #419

Sherlouk opened this issue Sep 24, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@Sherlouk
Copy link
Collaborator

  • When showMatchesPosition is true, matchPositions should 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?.count where 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.
  • When attributesToHighlight is not empty, formattedDocument should be defined

    • This will be an instance of T (the document itself), but values may be changed based on search inputs

Solution is reliant on #413 being merged to avoid additional breaking changes.

@curquiza curquiza added the enhancement New feature or request label Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants