Skip to content

Commit

Permalink
Remove CommonTermsQuery and cutoff_frequency param (#42654)
Browse files Browse the repository at this point in the history
Remove `common` query and `cutoff_frequency` parameter of
`match` and `multi_match` queries. Both have already been
deprecated for the next 7.x version.

Closes: #37096
  • Loading branch information
matriv committed May 31, 2019
1 parent 931492d commit 6dd4d2b
Show file tree
Hide file tree
Showing 43 changed files with 74 additions and 1,920 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import static java.util.Collections.singletonMap;
import static org.elasticsearch.index.query.QueryBuilders.boolQuery;
import static org.elasticsearch.index.query.QueryBuilders.boostingQuery;
import static org.elasticsearch.index.query.QueryBuilders.commonTermsQuery;
import static org.elasticsearch.index.query.QueryBuilders.constantScoreQuery;
import static org.elasticsearch.index.query.QueryBuilders.disMaxQuery;
import static org.elasticsearch.index.query.QueryBuilders.existsQuery;
Expand Down Expand Up @@ -106,13 +105,6 @@ public void testBoosting() {
// end::boosting
}

public void testCommonTerms() {
// tag::common_terms
commonTermsQuery("name", // <1>
"kimchy"); // <2>
// end::common_terms
}

public void testConstantScore() {
// tag::constant_score
constantScoreQuery(
Expand Down
1 change: 0 additions & 1 deletion docs/java-rest/high-level/query-builders.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ This page lists all the available search queries with their corresponding `Query
| {ref}/query-dsl-match-query-phrase.html[Match Phrase] | {query-ref}/MatchPhraseQueryBuilder.html[MatchPhraseQueryBuilder] | {query-ref}/QueryBuilders.html#matchPhraseQuery-java.lang.String-java.lang.Object-[QueryBuilders.matchPhraseQuery()]
| {ref}/query-dsl-match-query-phrase-prefix.html[Match Phrase Prefix] | {query-ref}/MatchPhrasePrefixQueryBuilder.html[MatchPhrasePrefixQueryBuilder] | {query-ref}/QueryBuilders.html#matchPhrasePrefixQuery-java.lang.String-java.lang.Object-[QueryBuilders.matchPhrasePrefixQuery()]
| {ref}/query-dsl-multi-match-query.html[Multi Match] | {query-ref}/MultiMatchQueryBuilder.html[MultiMatchQueryBuilder] | {query-ref}/QueryBuilders.html#multiMatchQuery-java.lang.Object-java.lang.String\…-[QueryBuilders.multiMatchQuery()]
| {ref}/query-dsl-common-terms-query.html[Common Terms] | {query-ref}/CommonTermsQueryBuilder.html[CommonTermsQueryBuilder] | {query-ref}/QueryBuilders.html#commonTermsQuery-java.lang.String-java.lang.Object-[QueryBuilders.commonTermsQuery()]
| {ref}/query-dsl-query-string-query.html[Query String] | {query-ref}/QueryStringQueryBuilder.html[QueryStringQueryBuilder] | {query-ref}/QueryBuilders.html#queryStringQuery-java.lang.String-[QueryBuilders.queryStringQuery()]
| {ref}/query-dsl-simple-query-string-query.html[Simple Query String] | {query-ref}/SimpleQueryStringBuilder.html[SimpleQueryStringBuilder] | {query-ref}/QueryBuilders.html#simpleQueryStringQuery-java.lang.String-[QueryBuilders.simpleQueryStringQuery()]
|======
Expand Down
2 changes: 2 additions & 0 deletions docs/reference/migration/migrate_8_0.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ coming[8.0.0]
* <<breaking_80_transport_changes>>
* <<breaking_80_http_changes>>
* <<breaking_80_reindex_changes>>
* <<breaking_80_search_changes>>
* <<breaking_80_settings_changes>>

//NOTE: The notable-breaking-changes tagged regions are re-used in the
Expand Down Expand Up @@ -60,4 +61,5 @@ include::migrate_8_0/node.asciidoc[]
include::migrate_8_0/transport.asciidoc[]
include::migrate_8_0/http.asciidoc[]
include::migrate_8_0/reindex.asciidoc[]
include::migrate_8_0/search.asciidoc[]
include::migrate_8_0/settings.asciidoc[]
14 changes: 13 additions & 1 deletion docs/reference/migration/migrate_8_0/search.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,16 @@

The `/{index}/{type}/_search`, `/{index}/{type}/_msearch`, `/{index}/{type}/_search/template` and `/{index}/{type}/_msearch/template` REST endpoints have been removed in favour of `/{index}/_search`, `/{index}/_msearch`, `/{index}/_search/template` and `/{index}/_msearch/template`, since indexes no longer contain types, these typed endpoints are obsolete..

The `/{index}/{type}/_termvectors`, `/{index}/{type}/{id}/_termvectors` and `/{index}/{type}/_mtermvectors` REST endpoints have been removed in favour of `/{index}/_termvectors`, `/{index}/{id}/_termvectors` and `/{index}/_mtermvectors`, since indexes no longer contain types, these typed endpoints are obsolete..
The `/{index}/{type}/_termvectors`, `/{index}/{type}/{id}/_termvectors` and `/{index}/{type}/_mtermvectors` REST endpoints have been removed in favour of `/{index}/_termvectors`, `/{index}/{id}/_termvectors` and `/{index}/_mtermvectors`, since indexes no longer contain types, these typed endpoints are obsolete..

[float]
==== Removal of queries

The `common` query was deprecated in 7.x and has been removed in 8.0.
The same functionality can be achieved by the `match` query if the total number of hits is not tracked.

[float]
===== Removal of query parameters

The `cutoff_frequency` parameter was deprecated in 7.x and has been removed in 8.0 from `match` and `multi_match` queries.
The same functionality can be achieved without any configuration provided that the total number of hits is not tracked.
306 changes: 0 additions & 306 deletions docs/reference/query-dsl/common-terms-query.asciidoc

This file was deleted.

6 changes: 0 additions & 6 deletions docs/reference/query-dsl/full-text-queries.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ The queries in this group are:

The multi-field version of the `match` query.

<<query-dsl-common-terms-query,`common` terms query>>::

A more specialized query which gives more preference to uncommon words.

<<query-dsl-query-string-query,`query_string` query>>::

Supports the compact Lucene <<query-string-syntax,query string syntax>>,
Expand All @@ -59,8 +55,6 @@ include::match-bool-prefix-query.asciidoc[]

include::multi-match-query.asciidoc[]

include::common-terms-query.asciidoc[]

include::query-string-query.asciidoc[]

include::simple-query-string-query.asciidoc[]
Expand Down
Loading

0 comments on commit 6dd4d2b

Please sign in to comment.