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

Docs: Facets deprecated #6485

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions docs/reference/search/aggregations.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ This context is defined by the executed query in combination with the different
(filtered queries, top-level filters, and facet level filters). While powerful, their implementation is not designed
from the ground up to support complex aggregations and is thus limited.

.Are facets deprecated?
**********************************
As the functionality facets offer is a subset of the one offered by aggregations, over time, we would like to
see users move to aggregations for all realtime data analytics. That said, we are well aware that such
transitions/migrations take time, and for this reason we are keeping facets around for the time being.
Facets are not officially deprecated yet but are likely to be in the future.
**********************************

The aggregations module breaks the barriers the current facet implementation put in place. The new name ("Aggregations")
also indicates the intention here - a generic yet extremely powerful framework for building aggregations - any types of
aggregations.
Expand Down
2 changes: 2 additions & 0 deletions docs/reference/search/facets.asciidoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[[search-facets]]
== Facets

include::facets/deprecated.asciidoc[]

The usual purpose of a full-text search engine is to return a small
number of documents matching your query.

Expand Down
2 changes: 2 additions & 0 deletions docs/reference/search/facets/date-histogram-facet.asciidoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[[search-facets-date-histogram-facet]]
=== Date Histogram Facet

include::deprecated.asciidoc[]

A specific histogram facet that can work with `date` field types
enhancing it over the regular
<<search-facets-histogram-facet,histogram
Expand Down
3 changes: 3 additions & 0 deletions docs/reference/search/facets/deprecated.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[WARNING]
Facets are deprecated and will be removed in a future release. You are
encouraged to migrate to <<search-aggregations, aggregations>> instead.
2 changes: 2 additions & 0 deletions docs/reference/search/facets/filter-facet.asciidoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[[search-facets-filter-facet]]
=== Filter Facets

include::deprecated.asciidoc[]

A filter facet (not to be confused with a
<<search-facets,facet filter>>) allows you to
return a count of the hits matching the filter. The filter itself can be
Expand Down
2 changes: 2 additions & 0 deletions docs/reference/search/facets/geo-distance-facet.asciidoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[[search-facets-geo-distance-facet]]
=== Geo Distance Facets

include::deprecated.asciidoc[]

The geo_distance facet is a facet providing information for ranges of
distances from a provided geo_point including count of the number of
hits that fall within each range, and aggregation information (like
Expand Down
2 changes: 2 additions & 0 deletions docs/reference/search/facets/histogram-facet.asciidoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[[search-facets-histogram-facet]]
=== Histogram Facets

include::deprecated.asciidoc[]

The histogram facet works with numeric data by building a histogram
across intervals of the field values. Each value is "rounded" into an
interval (or placed in a bucket), and statistics are provided per
Expand Down
2 changes: 2 additions & 0 deletions docs/reference/search/facets/query-facet.asciidoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[[search-facets-query-facet]]
=== Query Facets

include::deprecated.asciidoc[]

A facet query allows to return a count of the hits matching the facet
query. The query itself can be expressed using the Query DSL. For
example:
Expand Down
2 changes: 2 additions & 0 deletions docs/reference/search/facets/range-facet.asciidoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[[search-facets-range-facet]]
=== Range Facets

include::deprecated.asciidoc[]

`range` facet allows to specify a set of ranges and get both the number
of docs (count) that fall within each range, and aggregated data either
based on the field, or using another field. Here is a simple example:
Expand Down
2 changes: 2 additions & 0 deletions docs/reference/search/facets/statistical-facet.asciidoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[[search-facets-statistical-facet]]
=== Statistical Facet

include::deprecated.asciidoc[]

Statistical facet allows to compute statistical data on a numeric
fields. The statistical data include count, total, sum of squares, mean
(average), minimum, maximum, variance, and standard deviation. Here is
Expand Down
2 changes: 2 additions & 0 deletions docs/reference/search/facets/terms-facet.asciidoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[[search-facets-terms-facet]]
=== Terms Facet

include::deprecated.asciidoc[]

Allow to specify field facets that return the N most frequent terms. For
example:

Expand Down
2 changes: 2 additions & 0 deletions docs/reference/search/facets/terms-stats-facet.asciidoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[[search-facets-terms-stats-facet]]
=== Terms Stats Facet

include::deprecated.asciidoc[]

The `terms_stats` facet combines both the
<<search-facets-terms-facet,terms>> and
<<search-facets-statistical-facet,statistical>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -525,47 +525,59 @@ public SearchRequestBuilder addFields(String... fields) {

/**
* Adds a facet to the search operation.
* @deprecated Facets are deprecated and will be removed in a future release. Please use aggregations instead.
*/
@Deprecated
public SearchRequestBuilder addFacet(FacetBuilder facet) {
sourceBuilder().facet(facet);
return this;
}

/**
* Sets a raw (xcontent) binary representation of facets to use.
* @deprecated Facets are deprecated and will be removed in a future release. Please use aggregations instead.
*/
@Deprecated
public SearchRequestBuilder setFacets(BytesReference facets) {
sourceBuilder().facets(facets);
return this;
}

/**
* Sets a raw (xcontent) binary representation of facets to use.
* @deprecated Facets are deprecated and will be removed in a future release. Please use aggregations instead.
*/
@Deprecated
public SearchRequestBuilder setFacets(byte[] facets) {
sourceBuilder().facets(facets);
return this;
}

/**
* Sets a raw (xcontent) binary representation of facets to use.
* @deprecated Facets are deprecated and will be removed in a future release. Please use aggregations instead.
*/
@Deprecated
public SearchRequestBuilder setFacets(byte[] facets, int facetsOffset, int facetsLength) {
sourceBuilder().facets(facets, facetsOffset, facetsLength);
return this;
}

/**
* Sets a raw (xcontent) binary representation of facets to use.
* @deprecated Facets are deprecated and will be removed in a future release. Please use aggregations instead.
*/
@Deprecated
public SearchRequestBuilder setFacets(XContentBuilder facets) {
sourceBuilder().facets(facets);
return this;
}

/**
* Sets a raw (xcontent) binary representation of facets to use.
* @deprecated Facets are deprecated and will be removed in a future release. Please use aggregations instead.
*/
@Deprecated
public SearchRequestBuilder setFacets(Map facets) {
sourceBuilder().facets(facets);
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@
import org.elasticsearch.search.facet.termsstats.TermsStatsFacetBuilder;

/**
*
* @deprecated Facets are deprecated and will be removed in a future release. Please use aggregations instead.
*/
@Deprecated
public class FacetBuilders {

public static QueryFacetBuilder queryFacet(String facetName) {
Expand Down