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

Highlighted fields is not getting passed to the elastic search query [DATAES-412] #985

Closed
spring-projects-issues opened this issue Oct 27, 2017 · 4 comments
Labels
type: bug

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Oct 27, 2017

Mohamed Muhad opened DATAES-412 and commented

Please refer the detailed issue description in the stack over flow link
https://stackoverflow.com/questions/46752784/elastic-search-5-5-highlight-field-is-not-working
Summary :
When I add multiple highlighted fields to the NativeSearchQueryBuilder , only the last highlighted field is actually being sent to Elastic Search

Based on my observation from the code , the problem may be in the below logic.
Only the last highlight builder finally gets set in SearchRequestBuilder.java

+ElasticSearchTemplate.java+

if (searchQuery.getHighlightFields() != null) {
for (HighlightBuilder.Field highlightField : searchQuery.getHighlightFields()) {
searchRequest.highlighter(new HighlightBuilder().field(highlightField));
}
}

+SearchRequestBuilder.java+

public SearchRequestBuilder highlighter(HighlightBuilder highlightBuilder) {
sourceBuilder().highlighter(highlightBuilder);
return this;
}


Reference URL: https://stackoverflow.com/questions/46752784/elastic-search-5-5-highlight-field-is-not-working

Referenced from: pull request #204

Backported to: 3.0.7 (Kay SR7)

1 votes, 3 watchers

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Oct 28, 2017

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Oct 28, 2017

Mohamed Muhad commented

Please review

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented May 7, 2018

Sascha Woo commented

Thank you for submitting the issue and the detailed description of how to solve the problem.

I've created a Pull Request and will merge it in asap.
#204

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented May 7, 2018

Sascha Woo commented

Merged and backported to 3.0.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug
Projects
None yet
Development

No branches or pull requests

1 participant