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

Handle Dynamic Highlight Fields Transformation in azure-db #9

Open
5 tasks
k-allagbe opened this issue Nov 30, 2023 · 0 comments
Open
5 tasks

Handle Dynamic Highlight Fields Transformation in azure-db #9

k-allagbe opened this issue Nov 30, 2023 · 0 comments

Comments

@k-allagbe
Copy link
Member

The current implementation of transform_result in our Azure Cognitive Search integration is hardcoded to search for "content" in @search.highlights. This approach is not flexible and fails to handle cases where highlight_fields is set to other fields or is None. We need to refactor this function to dynamically handle different highlight_fields and gracefully handle situations where highlight_fields is None (i.e., highlighting is not used).

Tasks

  • Modify transform_result to dynamically check for highlighted content based on the fields specified in highlight_fields.
  • Implement a check in transform_result to bypass looking in @search.highlights when highlight_fields is None.
  • Ensure that the original content of a field is used when its highlights are not available or when highlight_fields is None.
  • Add support for handling multiple fields in highlight_fields.
  • Write unit tests to cover various scenarios, including:
    • highlight_fields set to different fields (other than "content").
    • highlight_fields set to None.
    • Multiple fields specified in highlight_fields.
    • Absence of expected highlights in search results.

Acceptance Criteria

  • The transform_result function should dynamically handle the fields specified in highlight_fields, returning highlighted content appropriately.
  • When highlight_fields is None, the function should not attempt to access @search.highlights and should use the original field content.
  • The function must handle multiple highlight fields correctly, ensuring consistent results across different configurations.
  • The solution must be robust, handling all specified edge cases, with unit tests confirming the expected behavior.
@k-allagbe k-allagbe removed this from Finesse Dec 13, 2023
@ibrahim-kabir ibrahim-kabir moved this to Todo in Finesse Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant