Commit graph

697 commits

Author SHA1 Message Date
Benjamin Trent
56eed56152
Clarify that duplicate _name values for queries in the same request is undefined (#101523) (#101559)
relates to: #101480
2023-10-30 15:22:15 -04:00
Benjamin Trent
8196483590
Updating percolate query docs to account for custom similarity limitation (#101386) (#101442) 2023-10-27 07:12:21 -04:00
Julie Tibshirani
738e60ca5f
Avoid negative scores with cross_fields type (#89843)
The cross_fields scoring type can produce negative scores when some documents
are missing fields. When blending term document frequencies, we take the maximum
document frequency across all fields. If one field appears in fewer documents
than another, this means that its IDF can become negative. This is because IDF
is calculated as `Math.log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5))`

This change adjusts the docFreq for each field to `Math.min(docCount, docFreq)`
so that the IDF can never become negative. It makes sense that the term document
frequency should never exceed the number of documents containing the field.
2022-09-07 07:58:15 -07:00
Mayya Sharipova
199dedfe68 Undeprecate function_score query (#87807)
We had a plan to deprecate function_score query with
script_score query, but ran into a roadblock of missing
functionality to combine scores from different
functions (particularly "first" script_score).
Wee have several proposal to address this missing
functionality:
 [scripted_boolean](https://github.com/elastic/elasticsearch/issues/27588#issuecomment-444887726)
 [compound_query](https://github.com/elastic/elasticsearch/issues/51967)
 [first_query](https://github.com/elastic/elasticsearch/issues/52482)

But for now, we decided not to deprecate function_score query,
and hence we need to remove any mention that we are deprecating it.

Relates to #42811
Closes #71934
2022-06-17 11:08:47 -04:00
Luca Cavanna
383a3d1371
[DOCS] Clarify index_prefix in prefix query docs (#87450)
The current docs mention that Elasticsearch indexes prefixes between 2 and 5 characters in a separate field. 2 and 5 are default values, and the size of the prefixes indexed depend on the configuration settings.
2022-06-14 14:46:25 +02:00
James Rodewig
eedb9b1475
[DOCS] Move tip for percolate query example (#83972) (#83986)
Moves a tip for the percolate query to the beginning of the example.

(cherry picked from commit c1aba1e109)
2022-02-15 16:10:12 -05:00
James Rodewig
f788a25aa5
[DOCS] Re-add network traffic para to term query (#83047) (#83067)
Re-adds a paragraph about minimizing network traffic for a terms lookup.

This paragraph was erroneously removed as part of https://github.com/elastic/elasticsearch/pull/42889.

(cherry picked from commit b552d5cb0e)
2022-01-25 10:39:01 -05:00
James Rodewig
3ccdcbe21f
[DOCS] Document missing flag values for regexp query (#82265) (#82761)
Documents the `EMPTY` and `NONE` `flag` values for the `regexp` query.

Also documents the `""` (empty string) value, which is an alias for `ALL`.

Closes #81978.

(cherry picked from commit e53ecc3f43)
2022-01-18 14:28:24 -05:00
James Rodewig
699586f7a9
[DOCS] Fix track_total_hits xref (#82739) (#82752)
(cherry picked from commit 13e9a605b8)

Co-authored-by: jenish jain <jenishjain@rocketmail.com>
2022-01-18 12:56:52 -05:00
James Rodewig
45e054d1ac
[7.17] [DOCS] Clarify nested query behavior for must_not clauses (#82727) (#82735)
* [DOCS] Clarify `nested` query behavior for `must_not` clauses (#82727)

Closes #81052.

(cherry picked from commit 0a3f6acadd)

* Add doc type

* Fix doc type
2022-01-18 10:53:30 -05:00
James Rodewig
2f27f3ca52
[DOCS] Note that default_field support wildcards (#81127) (#82199)
Changes:

* Notes that the query string query's `default_field` and `fields` parameters support wildcards.
* Adds an xref to the `index.query.default_field` docs to the `default_field` parameter.

(cherry picked from commit f5f76ff1ca)
2022-01-04 08:44:09 -05:00
James Rodewig
8d42b0d056
[DOCS] Fix combined_fields query ref in multi_match query docs (#81456) (#81472)
The current `multi_match` docs contain an erroneous reference to the `combined_fields` query. This updates the reference to reference the correct query.

Relates to https://github.com/elastic/elasticsearch/pull/76893
# Conflicts:
#	docs/reference/query-dsl/combined-fields-query.asciidoc
2021-12-07 17:09:35 -05:00
James Rodewig
07ac8818b6
[DOCS] Remove testenv annotations from doc snippet tests (#80023) (#80458)
Removes `testenv` annotations and related code. These annotations originally let you skip x-pack snippet tests in the docs. However, that's no longer possible.

Relates to #79309, #31619
# Conflicts:
#	docs/reference/ml/df-analytics/apis/get-trained-model-deployment-stats.asciidoc
#	docs/reference/ml/df-analytics/apis/infer-trained-model-deployment.asciidoc
#	docs/reference/ml/df-analytics/apis/put-trained-model-definition-part.asciidoc
#	docs/reference/ml/df-analytics/apis/put-trained-model-vocabulary.asciidoc
#	docs/reference/ml/df-analytics/apis/start-trained-model-deployment.asciidoc
#	docs/reference/ml/df-analytics/apis/stop-trained-model-deployment.asciidoc
#	docs/reference/slm/apis/slm-delete.asciidoc
#	docs/reference/slm/apis/slm-execute-retention.asciidoc
#	docs/reference/slm/apis/slm-execute.asciidoc
#	docs/reference/slm/apis/slm-get-status.asciidoc
#	docs/reference/slm/apis/slm-get.asciidoc
#	docs/reference/slm/apis/slm-start.asciidoc
#	docs/reference/slm/apis/slm-stats.asciidoc
#	docs/reference/slm/apis/slm-stop.asciidoc
#	docs/reference/sql/endpoints/client-apps/tableau-desktop.asciidoc
#	docs/reference/sql/endpoints/client-apps/tableau-server.asciidoc
2021-11-05 19:41:54 -04:00
James Rodewig
a559208403
[DOCS] Add wildcard parameter to wildcard query docs (#79722) (#79853)
Changes:

* Documents the `wildcard` parameter for the `wildcard` query. This parameter is an alias for the `value` parameter.
* Reorders the parameters alphabetically.

Closes #79711
2021-10-26 12:45:22 -04:00
James Rodewig
a2ff480fe5
[DOCS] Add script note to nested query docs (#77431) (#78700)
As the script has only access to the nested document, this should be
documented.

Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>

Co-authored-by: Alexander Reelsen <alexander@reelsen.net>
2021-10-05 10:42:17 -04:00
James Rodewig
69ce3aee52
[DOCS] Clarify geoshape orientation docs (#75888) (#77445)
Adds additional information about how Elasticsearch uses polygon orientation. Elasticsearch only uses a polygon's orientation to determine if it crosses the international dateline. If so, Elasticsearch splits the polygon at the dateline.

Closes #74891
# Conflicts:
#	docs/reference/mapping/types/geo-shape.asciidoc
2021-09-08 11:30:17 -04:00
Adam Locke
71a5982352
[DOCS] Update combined fields wording (#76893) (#76993)
* [DOCS] Update combined fields wording

* Clarifications from review feedback
2021-08-26 14:27:09 -04:00
James Rodewig
ad706fe684
[DOCS] Add search xref tip to query_string docs (#76728) (#76756)
Adds a tip containing a cross-reference to the "Search your data" docs.
This is the preferred starting point for ES search.
2021-08-20 08:55:19 -04:00
Paweł Krześniak
7c574dcfe1
[DOCS] Fix typo in parent-child example request (#76646) (#76655) 2021-08-18 09:16:25 -04:00
James Rodewig
96ed07f1df
[DOCS] Terms lookup doesn't support remote indices (#76371) (#76413)
Changes:
* Notes that you can't use cross-cluster search to run a terms lookup on a remote index.
* Removes a redundant sentence noting `_source` is enabled by default.

Closes #61364.
2021-08-12 08:43:24 -04:00
James Rodewig
4d881f57e1
[DOCS] Correct spelling for geo terms (#76028) (#76032)
Changes:
* Use "geopoint" when not referring to the literal field type
* Use "geoshape" when not referring to the literal field type or query type
* Use "GeoJSON" consistently
# Conflicts:
#	docs/reference/ingest/processors/enrich.asciidoc
2021-08-03 10:08:52 -04:00
Julie Tibshirani
1d03ddec0b
Allow specifying index in pinned queries (#75734)
The current `ids` option doesn't allow pinning a specific document in a
single index when searching over multiple indices. This introduces a
`documents` option, which is an array of `_id` and `_index`
fields to allow index-specific pins.

Closes https://github.com/elastic/elasticsearch/issues/67855.

Co-authored-by: David Harsha <david.harsha@elastic.co>
2021-07-27 18:45:01 +03:00
André Pessanha
fc5b80abea Rename field_masking_span to span_field_masking (#74718)
`field_masking_span` is the only span query that does not begin with
`span_`.  This commit deprecates the existing name and adds a new
name `span_field_masking` to better fit with the other queries.
2021-07-09 09:08:30 +01:00
James Rodewig
c6df1d9074
[DOCS] Query strings are normalized for fuzzy (~) operator (#73921) (#74645)
Notes that `fuzzy` queries made using the query string query's `~`
operator are normalized.

Closes #73299
2021-06-28 13:28:23 -04:00
James Rodewig
3dc091176e
[DOCS] Deprecate geo_bounding_box query's type param (#74008) (#74009)
The `geo_bounding_box` query's `type` parameter is currently ignored and has no
effect on the query. This documents the deprecation of the parameter in 7.14.0.
The parameter will be removed in 8.0.0.

Relates to #70561. Backport of #74008.
2021-06-24 11:14:48 -04:00
Ignacio Vera
d0dd49b978
Deprecate Bounding box query type parameter (#74493) (#74535)
This parameter has no effect on the query execution.
2021-06-24 08:34:35 +02:00
Mayya Sharipova
86b6d22fe5 Add doc on rank_feature(s) negative score impact (#71795)
Add a warning about consequences of negative score impact
for documents that don't have values for rank_feature(s)
fields.

Related to #69994
2021-04-20 06:59:13 -04:00
Julie Tibshirani
a6783a29dd
Introduce combined_fields query (#71711)
This PR introduces a new query called `combined_fields` for searching multiple
text fields. It takes a term-centric view, first analyzing the query string
into individual terms, then searching for each term any of the fields as though
they were one combined field. It is based on Lucene's `CombinedFieldQuery`,
which takes a principled approach to scoring based on the BM25F formula.

This query provides an alternative to the `cross_fields` `multi_match` mode. It
has simpler behavior and a more robust approach to scoring.

Addresses #41106.
2021-04-14 16:04:37 -07:00
Adam Locke
d0e7cc3332
[DOCS] Update runtime fields for script query (#71338) (#71347)
Fixes typo, moves example out of a NOTE admonition, and puts context before the example.
2021-04-06 11:01:28 -04:00
Nik Everett
317afdf433
Point script query docs at runtime fields (backport of #71291) (#71300)
This adds a "note" on the docs for the script query pointing folks to
runtime fields because they are more flexible. It also translates the
request example into runtime fields.

Co-authored-by: Adam Locke <adam.locke@elastic.co>
2021-04-05 16:54:16 -04:00
Adam Locke
836ef8da57
[DOCS] Fixes deprecation message for Geo-polygon query (#71141) (#71148)
* [DOCS] Fixes deprecation message for Geo-polygon query

* Change deprecation to full block admonition.
2021-03-31 16:50:02 -04:00
James Rodewig
c757f9e4e7
[DOCS] Fix double spaces (#71082) (#71120) 2021-03-31 11:43:34 -04:00
James Rodewig
1a914b8a15
[DOCS] Document index.query.default_field index setting (#69922) (#70528) 2021-03-17 17:35:08 -04:00
Julie Tibshirani
2695fc1ea6 Correct cross_fields docs on how analyzer groups are combined. (#69936)
When performing a multi_match in cross_fields mode, we group fields based on
their analyzer and create a blended query per group. Our docs claimed that the
group scores were combined through a boolean query, but they are actually
combined through a dismax that incorporates the tiebreaker parameter.

This commit updates the docs and adds a test verifying the behavior.
2021-03-08 15:20:34 -08:00
James Rodewig
51b36a5363
[DOCS] Fix prefix_length data type (#70075) (#70082) 2021-03-08 09:45:36 -05:00
James Rodewig
abfacfc7ff
[DOCS] Note case_sensitive param was added in 7.10 (#69405) (#69467)
Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>

Co-authored-by: Bhavya Gupta <46423346+bhavya121999@users.noreply.github.com>
2021-02-23 13:12:35 -05:00
James Rodewig
7f7dc9dec3
[DOCS] Fix capitalization for Query DSL (#69236) (#69240) 2021-02-18 19:40:36 -05:00
James Rodewig
dfe113b68d
[DOCS] Expand simple query string query's multi-position token section (#68753) (#68784) 2021-02-09 17:12:39 -05:00
Ignacio Vera
5e51796908
Deprecate GeoPolygon query in favour of GeoShape query. (#64227) (#68726) 2021-02-09 11:55:03 +01:00
James Rodewig
dd1cfc1414
[DOCS] Update example request description (#68587) (#68659)
The doc is misleading : The following intervals search returns documents containing `my favorite food` **immediately** followed by `hot water` or `cold porridge`

max_gaps apply only to the match query and is not used for checking proximity with the other match, the example given actually`This search would match a my_text value of my favorite food is cold`

Co-authored-by: Julien Guay <guay_j@yahoo.fr>
2021-02-08 08:51:28 -05:00
James Rodewig
3ca92e6fd5
[DOCS] Remove outdated deprecated notes (#68246) (#68300) 2021-02-01 09:47:46 -05:00
Ignacio Vera
169444ec78
Add support for Spatial Relationships to geo_point field (#67631) (#67762)
Lucene 8.8 supports to query LatLonPoint field using spatial relationships.
2021-01-20 16:20:32 +01:00
Mayya Sharipova
e42b45329e
Add linear function to rank_feature query (#67438) (#67670)
This adds a linear function to the set of functions available
for rank_feature query

Closes #49859
Backport for #67438
2021-01-18 13:40:24 -05:00
James Rodewig
aea83909d9
[DOCS] Fix case for 'Boolean' (#64299) (#64341) 2020-10-29 10:04:20 -04:00
Ignacio Vera
6a51e96edb
Enable geo_distance and geo_bounding_box queries on geo_shape field type (#64224) (#64326) 2020-10-29 10:49:45 +01:00
markharwood
bac6bd07d0
Search - make term/prefix/wildcard/regex query parsing more lenient (#63926) (#63981)
* Remove errors when case_insensitive flag set to false

Closes #63893
2020-10-21 11:51:10 +01:00
James Rodewig
5164eb9850
[DOCS] Clarifies the effect of per-field boosting (#63733) (#63743)
The original description of per-field boosting is incorrect. Boosting a
field does not imply that it is more important relative to other fields.
It simply means that the score is multiplied by the supplied boost
value. Due to the differences in each field's term and document
statistics, it's not possible to imply relative importance of fields
based on the per-field boost value alone.

Co-authored-by: Josh Devins <josh.devins@elastic.co>
2020-10-15 09:44:41 -04:00
Przemyslaw Gomulka
ee500c10b9
[doc] Rounding range query rules backport(#63109) (#63155)
a documentation explaining defaulting of missing fields when using date math parser.
relates #62268
2020-10-02 09:40:01 +02:00
markharwood
a0df0fb074
Search - add case insensitive flag for "term" family of queries #61596 (#62661)
Backport of fe9145f

Closes #61546
2020-09-22 13:56:51 +01:00
James Rodewig
f1522fcafc
[DOCS] Fix range query admon for clarity (#62163) (#62171) 2020-09-09 10:37:43 -04:00