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

No description provided.

@ericholscher ericholscher added the PR: hotfix Pull request applied as hotfix to release label Jul 17, 2019
@dojutsu-user
Copy link
Member

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

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

@ericholscher
I have opened PR #5950

@ericholscher
Copy link
Member Author

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
@delete-merged-branch delete-merged-branch bot deleted the fix-invalid-highlight-access branch July 17, 2019 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: hotfix Pull request applied as hotfix to release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants