parent/child: Deprecated the `top_children` in favour of the `has_child` query.

This commit is contained in:
Martijn van Groningen 2015-05-06 20:01:30 +02:00
parent 82c21ff5b3
commit f7c29457d0
6 changed files with 13 additions and 0 deletions

View File

@ -8,3 +8,10 @@ your application from Elasticsearch 1.x to Elasticsearch 1.6.
=== More Like This API
The More Like This API query has been deprecated and will be removed in 2.0. Instead use the <<query-dsl-mlt-query, More Like This Query>>.
[float]
=== `top_children` query
The `top_children` query has been deprecated and will be removed in 2.0. Instead the `has_child` query should be used.
The `top_children` query isn't always faster than the `has_child` query and the `top_children` query is often inaccurate.
The total hits and any aggregations in the same search request will likely be off.

View File

@ -1,6 +1,8 @@
[[query-dsl-top-children-query]]
=== Top Children Query
deprecated[1.6.0, Use the `has_child` query instead]
The `top_children` query runs the child query with an estimated hits
size, and out of the hit docs, aggregates it into parent docs. If there
aren't enough parent docs matching the requested from/size search

View File

@ -475,6 +475,7 @@ public abstract class QueryBuilders {
* @param type The child type.
* @param query The query.
*/
@Deprecated
public static TopChildrenQueryBuilder topChildrenQuery(String type, QueryBuilder query) {
return new TopChildrenQueryBuilder(type, query);
}

View File

@ -25,6 +25,7 @@ import java.io.IOException;
/**
*
*/
@Deprecated
public class TopChildrenQueryBuilder extends BaseQueryBuilder implements BoostableQueryBuilder<TopChildrenQueryBuilder> {
private final QueryBuilder queryBuilder;

View File

@ -38,6 +38,7 @@ import java.io.IOException;
/**
*
*/
@Deprecated
public class TopChildrenQueryParser implements QueryParser {
public static final String NAME = "top_children";

View File

@ -54,6 +54,7 @@ import java.util.Set;
* This query is most of the times faster than the {@link ChildrenQuery}. Usually enough parent documents can be returned
* in the first child document query round.
*/
@Deprecated
public class TopChildrenQuery extends IndexCacheableQuery {
private static final ParentDocComparator PARENT_DOC_COMP = new ParentDocComparator();