Skip to content

Commit

Permalink
parent/child: Removed the top_children query.
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnvg committed May 10, 2015
1 parent 9e01ded commit acdd9a5
Show file tree
Hide file tree
Showing 15 changed files with 15 additions and 1,127 deletions.
22 changes: 0 additions & 22 deletions docs/java-api/query-dsl-queries.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -397,28 +397,6 @@ QueryBuilder qb = termsQuery("tags", <1>
<2> values
<3> how many terms must match at least

[[top-children]]
=== Top Children Query

See {ref}/query-dsl-top-children-query.html[Top Children Query]

[source,java]
--------------------------------------------------
QueryBuilder qb = topChildrenQuery(
"blog_tag", <1>
termQuery("tag", "something") <2>
)
.score("max") <3>
.factor(5) <4>
.incrementalFactor(2); <5>
--------------------------------------------------
<1> field
<2> query
<3> `max`, `sum` or `avg`
<4> how many hits are asked for in the first child query run (defaults to 5)
<5> if not enough parents are found, and there are still more child docs to query, then the child search hits are
expanded by multiplying by the incremental_factor (defaults to 2).

[[wildcard]]
=== Wildcard Query

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/docs/delete-by-query.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,4 @@ is the same).
[[limitations]]
=== Limitations

The delete by query does not support the following queries and filters: `has_child`, `has_parent` and `top_children`.
The delete by query does not support the following queries and filters: `has_child` and `has_parent`.
7 changes: 7 additions & 0 deletions docs/reference/migration/migrate_2_0.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -513,3 +513,10 @@ Client client = TransportClient.builder().settings(settings).build();

Log messages are now truncated at 10,000 characters. This can be changed in the
`logging.yml` configuration file.

[float]
=== Removed `top_children` query

The `top_children` query has been removed in favour of the `has_child` query. The `top_children` query wasn't always faster
than the `has_child` query and the `top_children` query was often inaccurate. The total hits and any aggregations in the
same search request will likely be off if `top_children` was used.
5 changes: 0 additions & 5 deletions docs/reference/query-dsl/has-child-query.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ an example:
}
--------------------------------------------------

An important difference with the `top_children` query is that this query
is always executed in two iterations whereas the `top_children` query
can be executed in one or more iteration. When using the `has_child`
query the `total_hits` is always correct.

[float]
=== Scoring capabilities

Expand Down
2 changes: 0 additions & 2 deletions docs/reference/query-dsl/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ include::term-query.asciidoc[]

include::terms-query.asciidoc[]

include::top-children-query.asciidoc[]

include::wildcard-query.asciidoc[]

include::minimum-should-match.asciidoc[]
Expand Down
86 changes: 0 additions & 86 deletions docs/reference/query-dsl/top-children-query.asciidoc

This file was deleted.

2 changes: 1 addition & 1 deletion docs/reference/search/percolate.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ the time the percolate API needs to run can be decreased.
=== Important Notes

Because the percolator API is processing one document at a time, it doesn't support queries and filters that run
against child documents such as `has_child`, `has_parent` and `top_children`.
against child documents such as `has_child` and `has_parent`.

The `wildcard` and `regexp` query natively use a lot of memory and because the percolator keeps the queries into memory
this can easily take up the available memory in the heap space. If possible try to use a `prefix` query or ngramming to
Expand Down
12 changes: 0 additions & 12 deletions src/main/java/org/elasticsearch/index/query/QueryBuilders.java
Original file line number Diff line number Diff line change
Expand Up @@ -423,18 +423,6 @@ public static MoreLikeThisQueryBuilder moreLikeThisQuery() {
return new MoreLikeThisQueryBuilder();
}

/**
* Constructs a new scoring child query, with the child type and the query to run on the child documents. The
* results of this query are the parent docs that those child docs matched.
*
* @param type The child type.
* @param query The query.
*/
@Deprecated
public static TopChildrenQueryBuilder topChildrenQuery(String type, QueryBuilder query) {
return new TopChildrenQueryBuilder(type, query);
}

/**
* Constructs a new NON scoring child query, with the child type and the query to run on the child documents. The
* results of this query are the parent docs that those child docs matched.
Expand Down

This file was deleted.

Loading

0 comments on commit acdd9a5

Please sign in to comment.