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

function_score: use query and filter together #8675

Closed
wants to merge 3 commits into from

Conversation

brwe
Copy link
Contributor

@brwe brwe commented Nov 26, 2014

Before, if filter and query was defined for function_score, then the
filter was silently ignored. Now, if both is defined then function score
query wraps this in a filtered_query.

closes #8638

Before, if filter and query was defined for function_score, then the
filter was silently ignored. Now, if both is defined then function score
query wraps this in a filtered_query.

closes elastic#8638
query = Queries.newMatchAllQuery();
}
if (query == null && filter != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there can all be else if no?

@s1monw
Copy link
Contributor

s1monw commented Nov 26, 2014

left two comments

@jpountz
Copy link
Contributor

jpountz commented Nov 27, 2014

Should we raise an error instead of implicitely wrapping into a FilteredQuery?

@clintongormley
Copy link

@jpountz I'm OK with wrapping this in a filtered query instead. It does what the user expects.

@jpountz
Copy link
Contributor

jpountz commented Nov 27, 2014

No objections, just wanted to make sure we considered this option too. :-)

@brwe
Copy link
Contributor Author

brwe commented Nov 27, 2014

thanks for the quick review! Addressed all comments.

@brwe
Copy link
Contributor Author

brwe commented Nov 27, 2014

closed f00b431

@brwe brwe closed this Nov 27, 2014
@brwe
Copy link
Contributor Author

brwe commented Nov 27, 2014

oh. wrong window, sorry

@brwe brwe reopened this Nov 27, 2014
@jpountz
Copy link
Contributor

jpountz commented Dec 3, 2014

LGTM

brwe added a commit that referenced this pull request Jan 19, 2015
Before, if filter and query was defined for function_score, then the
filter was silently ignored. Now, if both is defined then function score
query wraps this in a filtered_query.

closes #8638
closes #8675
@brwe brwe closed this in 7230e60 Jan 19, 2015
@clintongormley clintongormley added :Search/Search Search-related issues that do not fall into other categories and removed :Query DSL labels Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search/Search Search-related issues that do not fall into other categories v1.5.0 v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support query and filter in function_score
4 participants