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

Properly return None when there's no highlight on a hit. #5944

Merged
merged 2 commits into from Jul 17, 2019

Conversation

@ericholscher
Copy link
Member

@ericholscher ericholscher commented Jul 17, 2019

No description provided.

@ericholscher ericholscher requested a review from dojutsu-user Jul 17, 2019
@dojutsu-user
Copy link
Member

@dojutsu-user dojutsu-user commented Jul 17, 2019

This also needs to change --

sorted_results = [
{
'type': hit._nested.field,
# here _source term is not used because
# django gives error if the names of the
# variables start with underscore
'source': hit._source.to_dict(),
'highlight': utils._remove_newlines_from_dict(
hit.highlight.to_dict()
),
}
for hit in sorted(all_results, key=attrgetter('_score'), reverse=True)
]

I think we should move _get_inner_hits_highlights to search.utils and then use it from there?

@dojutsu-user
Copy link
Member

@dojutsu-user dojutsu-user commented Jul 17, 2019

I think it would be better to move the entire logic of sorting the search results to search.utils and call from there.

@dojutsu-user
Copy link
Member

@dojutsu-user dojutsu-user commented Jul 17, 2019

@ericholscher
I have opened PR #5950

@ericholscher
Copy link
Member Author

@ericholscher ericholscher commented Jul 17, 2019

Great, I'm going to merge this since it's already hotfixed, and then we can update that branch to not conflict 👍

@ericholscher ericholscher merged commit fda7fc3 into master Jul 17, 2019
1 check passed
@delete-merged-branch delete-merged-branch bot deleted the fix-invalid-highlight-access branch Jul 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants