You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 wherehighlight_fields
is set to other fields or isNone
. We need to refactor this function to dynamically handle differenthighlight_fields
and gracefully handle situations wherehighlight_fields
isNone
(i.e., highlighting is not used).Tasks
transform_result
to dynamically check for highlighted content based on the fields specified inhighlight_fields
.transform_result
to bypass looking in@search.highlights
whenhighlight_fields
isNone
.highlight_fields
isNone
.highlight_fields
.highlight_fields
set to different fields (other than "content").highlight_fields
set toNone
.highlight_fields
.Acceptance Criteria
transform_result
function should dynamically handle the fields specified inhighlight_fields
, returning highlighted content appropriately.highlight_fields
isNone
, the function should not attempt to access@search.highlights
and should use the original field content.The text was updated successfully, but these errors were encountered: