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

Improve filtering by _parent field #3454

Closed
martijnvg opened this Issue Aug 7, 2013 · 0 comments

Comments

Projects
None yet
1 participant
@martijnvg
Copy link
Member

martijnvg commented Aug 7, 2013

In the _parent field the type and id of the parent are stored as type#id, because of this a term filter on the _parent field with the parent id is always resolved to a terms filter with a type / id combination for each type in the mapping.

This can be improved by automatically use the most optimized filter (either term or terms) based on the number of parent types in the mapping.

Also add support to use the parent type in the term filter for the _parent field. Like this:

{
   "term" : {
        "_parent" : "parent_type#1"
    }
}

This will then always automatically use the term filter.

@ghost ghost assigned martijnvg Aug 7, 2013

@martijnvg martijnvg closed this in 73c038f Aug 7, 2013

martijnvg added a commit that referenced this issue Aug 7, 2013

Improved filtering by _parent field
In the _parent field the type and id of the parent are stored as type#id, because of this a term filter on the _parent field with the parent id is always resolved to a terms filter with a type / id combination for each type in the mapping.

This can be improved by automatically use the most optimized filter (either term or terms) based on the number of parent types in the mapping.

Also added support to use the parent type in the term filter for the _parent field. Like this:
```json
{
   "term" : {
        "_parent" : "parent_type#1"
    }
}
```
This will then always automatically use the term filter.

Closes #3454

martijnvg added a commit that referenced this issue Aug 7, 2013

martijnvg added a commit that referenced this issue Aug 7, 2013

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015

Improved filtering by _parent field
In the _parent field the type and id of the parent are stored as type#id, because of this a term filter on the _parent field with the parent id is always resolved to a terms filter with a type / id combination for each type in the mapping.

This can be improved by automatically use the most optimized filter (either term or terms) based on the number of parent types in the mapping.

Also added support to use the parent type in the term filter for the _parent field. Like this:
```json
{
   "term" : {
        "_parent" : "parent_type#1"
    }
}
```
This will then always automatically use the term filter.

Closes elastic#3454

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.