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

Take filters from aliases into account #9590

Merged
merged 1 commit into from Mar 17, 2015

Conversation

martijnvg
Copy link
Member

Take filters from index aliases into account when selecting queries to run on a document.

The filter from an indexed alias is as if you would filter on the metadata of a percolator query, but then the filter is defined in the index alias instead of the percolate request.

PR for #6241


final Filter filter;
if (context.aliasFilter() != null) {
filter = new AndFilter(Arrays.asList(context.aliasFilter(), percolatorTypeFilter));
Copy link
Member

Choose a reason for hiding this comment

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

order matters here right? wondering if type shouldn't be first, given that we don't know how expensive the alias filter will be since it's user provided. Thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes in the and filter that does matter. My reasoning was that the alias filter is more specific and will exclude more docs and that is why I put it first... Maybe I should use the bool filter instead, where such decisions are made automatically. (in master we can use bool query :) which is even better)

@javanna
Copy link
Member

javanna commented Feb 27, 2015

left a few cosmetic comments, LGTM otherwise

@martijnvg
Copy link
Member Author

@javanna I applied your feedback. Did my answers make sense?

@javanna
Copy link
Member

javanna commented Feb 27, 2015

answers made sense, thanks @martijnvg . Left a couple of comments around code comments in tests. LGTM though!

…ng queries to run on a document.

The filter from an indexed alias is as if you would filter on the metadata of a percolator query, but then the filter is defined in the index alias instead of the percolate request.

Closes elastic#6241
@martijnvg martijnvg merged commit f72a0b8 into elastic:1.x Mar 17, 2015
@clintongormley clintongormley added the :Search/Percolator Reverse search: find queries that match a document label Mar 19, 2015
@martijnvg martijnvg deleted the percolator/filtered_alias branch May 18, 2015 23:26
@clintongormley clintongormley changed the title Percolator: Take filters from aliases into account Take filters from aliases into account Jun 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search/Percolator Reverse search: find queries that match a document v1.5.0 v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants