Commit graph

686 commits

Author SHA1 Message Date
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
5f9d93e7d5
[DOCS] Add collapsible section to TSDB mapping parameters + index setting (#80230) (#80278) (#80280) 2021-11-03 10:24:22 -04:00
James Rodewig
5508b14847
[DOCS] Fix typo (#79609) (#79924)
Co-authored-by: Tobias Frey <75436831+sag-tobias-frey@users.noreply.github.com>
2021-10-27 11:19:02 -04:00
James Rodewig
a302a9d874
[DOCS] Add experimental label to TSDB mapping params and settings (#79647) (#79911)
Adds an `experimental` annotation to the following:

* `time_series_metric` mapping parameter
* `time_series_dimension` mapping parameter
* `index.mapping.dimension_fields.limit` index setting
*  `time_series_dimension` and `time_series_metric` properties in the field caps API response
# Conflicts:
#	docs/reference/search/field-caps.asciidoc
2021-10-27 09:25:15 -04:00
Christoph Büscher
e9524cb934
[Docs] Clarify ignore_above behaviour (#79705) (#79744)
Clarify that `keyword` fields that exceed the optional `ignore_above` setting
are inlcuded in the `_ignored` fields since 7.14.

Closes #79605
2021-10-25 14:36:54 -04:00
Mark Tozzi
9d149633b0
Revert 74559 (Avoid global ordinals in composite) (#78846)
This reverts the change to use segment ordinals in composite terms aggregations due to a performance degradation when the field is high cardinality.
2021-10-13 13:50:16 -04:00
James Rodewig
4575162cfc [DOCS] Fix typos in flattened field type docs 2021-10-05 14:15:25 -04:00
Christos Soulios
6cccbf55c3
[7.x] Add time_series_dimension and time_series_metric mapping parameters (#78265)
Backports the following PRs:

* Add dimension mapping parameter (#74450)

Added the dimension parameter to the following field types:

    keyword
    ip
    Numeric field types (integer, long, byte, short)

The dimension parameter is of type boolean (default: false) and is used
to mark that a field is a time series dimension field.

Relates to #74014

* Add constraints to dimension fields (#74939)

This PR adds the following constraints to dimension fields:

    It must be an indexed field and must has doc values
    It cannot be multi-valued
    The number of dimension fields in the index mapping must not be more than 16. This should be configurable through an index property (index.mapping.dimension_fields.limit)
    keyword fields cannot be more than 1024 bytes long
    keyword fields must not use a normalizer

Based on the code added in PR #74450
Relates to #74660

* Expand DocumentMapperTests (#76368)

Adds a test for setting the maximum number of dimensions setting and
tests the names and types of the metadata fields in the index.
Previously we just asserted the count of metadata fields. That made it
hard to read failures.

* Fix broken test for dimension keywords (#75408)

Test was failing because it was testing 1024 bytes long keyword and assertion was failing.

Closes #75225

* Checkstyle

* Add time_series_metric parameter (#76766)

This PR adds the time_series_metric parameter to the following field types:

    Numeric field types
    histogram
    aggregate_metric_double

* Rename `dimension` mapping parameter to `time_series_dimension` (#78012)

This PR renames dimension mapping parameter to time_series_dimension to make it consistent with time_series_metric parameter (#76766)

Relates to #74450 and #74014

* Add time series params to `unsigned_long` and `scaled_float` (#78204)

    Added the time_series_metric mapping parameter to the unsigned_long and scaled_float field types
    Added the time_series_dimension mapping parameter to the unsigned_long field type

Fixes #78100

Relates to #76766, #74450 and #74014

Co-authored-by: Nik Everett <nik9000@gmail.com>
2021-09-27 11:59:05 +03:00
James Rodewig
79ec031b26
[DOCS] Document time_series_metric mapping parameter (#78013) (#78247)
Changes:
* Documents the `time_series_metric` mapping parameter for PR #76766.
* Renames the `dimension` parameter to `time_series_dimension` for PR #78012.
* Adds support for `unsigned_long` to `time_series_dimension` for PR #78204.
2021-09-23 09:12:34 -04:00
Adam Locke
92ea5aa741
[DOCS] Add composite runtime fields (#78050) (#78178)
* [DOCS] Add composite runtime fields

* Update snippets and tests

* Add note that composite runtime fields cannot be indexed yet
# Conflicts:
#	docs/reference/mapping/runtime.asciidoc
2021-09-22 08:20:01 -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
James Rodewig
51a6a75790
[DOCS] Add admon for legacy prefix tree mapping params (#76582)
If you specify a deprecated mapping parameter related to prefix trees, a
`geo_shape` field will use prefix tree encoding.

This adds a related admon to the top of the geoshape field docs page. This admon will
help users avoid accidentally switching from the default BKD tree encoding.

Closes #40266.
2021-09-07 10:51:38 -04:00
Adam Locke
0877bbc1c9
[DOCS] Clarify indexing a runtime field (#77117) (#77139)
* [DOCS] Clarify indexing a runtime field

* Clarify wording based on reviewer feedback
# Conflicts:
#	docs/reference/mapping/runtime.asciidoc
2021-09-01 14:17:37 -04:00
Julie Tibshirani
bd47e6c151
Mention match_only_text in disk usage docs (#76416) (#76498)
* Mention match_only_text in disk usage docs

Previously we explained how to manually disable norms, freqs, and positions. We
now have a ready-made solution in the new `match_only_text` field type.

* Fixing typo and minor grammar changes

Co-authored-by: Adam Locke <adam.locke@elastic.co>

Co-authored-by: Adam Locke <adam.locke@elastic.co>
2021-08-13 10:12:01 -04:00
elasticsearchmachine
16192667f3
[DOCS] Clarify multi-field relationship to parent field (#76244) (#76252)
Closes #71659

Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
2021-08-09 11:54:11 -04:00
elasticsearchmachine
958c0be8b2
[DOCS] Update routing formulas (#76203) (#76250)
The `_routing` metadata field docs currently include formulas for how
Elasticsearch routes documents to shards. However, these formulas were not
updated for #18699.  This updates the routing formulas and adds xrefs for
related settings.

Closes #76072

Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
2021-08-09 11:53:24 -04:00
elasticsearchmachine
7047499561
[DOCS] Add retrieving runtime fields to introduction (#76084) (#76103)
Co-authored-by: Adam Locke <adam.locke@elastic.co>
2021-08-04 11:49:11 -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
James Rodewig
8cd2bc10cd
[Docs] Include index param in geo_point docs (#75798) (#76018)
Co-authored-by: a-k-g <aakash.goenka@gmail.com>
2021-08-03 09:07:00 -04:00
James Rodewig
05d616d344 [DOCS] Note dimension mapping parameter is for internal Elastic use 2021-07-30 09:03:01 -04:00
James Rodewig
fab33a6212
[DOCS] Document time series dimension mapping parameters (#75414) (#75475)
Changes:
* Documents the `dimension` mapping parameter for `ip`, `keyword`, and `numeric`
  fields.

* Documents the `index.mapping.dimension_fields.limit` index setting.
# Conflicts:
#	docs/reference/mapping/types/ip.asciidoc
#	docs/reference/mapping/types/keyword.asciidoc
#	docs/reference/mapping/types/numeric.asciidoc
2021-07-19 11:37:27 -04:00
Yannick Welsch
ec799ab27e Update docs that composite agg no longer uses global ords (#74754)
Follow-up to #74559
2021-07-05 11:26:59 +02:00
Adam Locke
a0f956ae18
[DOCS] Word changes for runtime field incentives (#74769) (#74787)
Incorporates feedback from #74454
2021-06-30 20:44:47 -04:00
Adam Locke
958891ee03
[DOCS] Add performance info for runtime fields (#74454) (#74699)
* [DOCS] Add performance info for runtime fields

* Add script-based sorting and clarify performance

* Changing title to Incentives and reworking the intro
2021-06-29 10:58:14 -04:00
Benjamin Trent
7f4df1632f
[7.x] Add support for range aggregations on histogram mapped fields (#74146) (#74682)
* Add support for range aggregations on histogram mapped fields (#74146)

This adds support for the range aggregation over `histogram` mapped fields.

Decisions made for implementation:

 - Sub-aggregations are not allowed. This is to simplify implementation and follows the prior art set by the `histogram` aggregation
 - Nothing fancy is done with the ranges. No filter translations as we cannot easily do a `range` filter query against histogram fields. This may be an optimization in the future.
 - Ranges check the histogram value ONLY. No interpolation of values is done. If we have better statistics around the histogram this MAY be possible.
2021-06-29 08:45:51 -04:00
Adam Locke
3d75a53f66
[DOCS] add missing dynamic runtime option (#74294) (#74363)
Co-authored-by: Luca Cavanna <javanna@users.noreply.github.com>
2021-06-21 10:22:20 -04:00
Luca Cavanna
e610094a02
Dynamic runtime to not dynamically create objects (#74234)
When we introduced dynamic:runtime (#65489) we decided to have it create objects dynamically under properties, as the runtime section did not (and still does not) support object fields. That proved to be a poor choice, because the runtime section is flat, supports dots in field names, and does not really need objects. Also, these end up causing unnecessary mapping conflicts.

With this commit we adapt dynamic:runtime to not dynamically create objects.

Closes #70268
2021-06-18 17:40:10 +02:00
James Rodewig
16d2142433 [DOCS] Change multi field to multi-field 2021-06-15 11:40:53 -04:00
Adam Locke
367c9d0a80
Update runtime.asciidoc (#73802) (#73838)
it looks typo in a few numbers there.

Co-authored-by: Daisuke Harada <1519063+dharada@users.noreply.github.com>
2021-06-07 09:51:29 -04:00
Adam Locke
54ba64c474
[DOCS] Retrieve values from flattened fields w/ runtime fields (#73630) (#73722)
* [DOCS] Add retriving from flattened fields

* Clarify sub-field syntax

* Moving sub-field retrieval to flattened field docs

* Remove full example and de-emphasize runtime fields

* Remove extraneous sample tag
2021-06-03 12:08:33 -04:00
Adam Locke
60cad596fc
[DOCS] [7.x] Create a new page for grok content in scripting docs (#73118) (#73495)
* [DOCS] [7.x]  Create a new page for grok content in scripting docs (#73118)

* [DOCS] Moving grok to its own scripting page

* Adding examples

* Updating cross link for grok page

* Adds same runtime field in a search request for #73262

* Clarify titles and shift navigation

* Incorporating review feedback

* Updating cross-link to Painless

* Adding doc type to response
2021-05-27 16:14:03 -04:00
Adam Locke
772ecc4d15
[DOCS] Expand information on using a runtime field without a script (#73219) (#73387)
* [DOCS] Expand information on when to use a runtime field without a script

* Reworking information based on review feedback

* Clarify case where doc_values are disabled

* A few minor changes from review feedback
2021-05-25 15:26:16 -04:00
James Rodewig
7ee176b101
[DOCS] Change field alias anchor (#73043) (#73047) 2021-05-13 10:43:45 -04:00
James Rodewig
f7f3f722d0
[DOCS] Remove and redirect frozen index overview content (#72990) (#73001)
Changes:

* Removes and adds redirects for the frozen indices [overview][0], [best
  practices][1], [search][2], and [monitoring][3] pages.
* Removes glossary terms related to frozen indices.
* Updates several xrefs to point to the freeze index API docs.

Relates to elastic/elasticsearch#72946 and elastic/elasticsearch#70192.

[0]: https://www.elastic.co/guide/en/elasticsearch/reference/7.12/frozen-indices.html
[1]: https://www.elastic.co/guide/en/elasticsearch/reference/master/best_practices.html
[2]: https://www.elastic.co/guide/en/elasticsearch/reference/master/searching_a_frozen_index.html
[3]: https://www.elastic.co/guide/en/elasticsearch/reference/master/monitoring_frozen_indices.html
2021-05-12 13:05:20 -04:00
Dominic Page
593945b34c docs amendment match-only-text has limited support for aggs (#72985) 2021-05-12 16:49:53 +02:00
Christoph Büscher
fcc4b53331 Enhance error message for copy-to (#72820)
We currently don't support `copy_to` for fields that take the form of objects
(e.g. `date_range` or certain kinds of `geo_point` variants). The current
problem with objects is that when DocumentParser parses anything other than
single values, it potentially advances the underlying parser past the value that
we would need to stay on for parsing the value again. While we might want to
support this in the future, for now this PR enhances the otherwise confusing
MapperParsingException with something more helpful and adds a short note in the
documentation about this restriction.

Closes #49344
2021-05-11 14:53:32 +02:00
James Rodewig
266ee2c98d
[DOCS] Fix bulk API xref (#72685) (#72707) 2021-05-04 11:23:02 -04:00
Adrien Grand
52a0eca8c4
Add match_only_text, a space-efficient variant of text. (#72064)
This adds a new `match_only_text` field, which indexes the same data as a `text`
field that has `index_options: docs` and `norms: false` and uses the `_source`
for positional queries like `match_phrase`. Unlike `text`, this field doesn't
support scoring.
2021-04-22 14:47:54 +02:00
Adam Locke
0e324d7723
[DOCS] [7.x] Focus retrieving selected fields on fields parameter (#71979)
* [DOCS] Focus retrieving selected fields on fields parameter (#71506)

* Incorporating changes from reviews

* Adding clarifications from review feedback

* Slight wording revisions.

* Clarify language around format parameter and move text out of callout.

* Fix code block start tagging
2021-04-20 15:45:45 -04: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
Luca Cavanna
827b9ef194
Rename on_script_error options to fail or continue (#71841)
As we started thinking about applying on_script_error to runtime fields, to handle script errors at search time, we would like to use the same parameter that was recently introduced for indexed fields. We decided that continue or fail gives a better indication of the behaviour compared to the current ignore or reject which is too specific to indexing documents.

This commit applies such rename.
2021-04-20 11:35:34 +02:00
Alan Woodward
bcf7669e52 Add index-time scripts to geo_point field mapper (#71861)
This commit adds the ability to define an index-time geo_point field
with a script parameter, allowing you to calculate points from other
values within the indexed document.
2021-04-20 10:25:08 +01:00
Mayya Sharipova
d53e83c3c4
Add access to dense_vector values (#71847)
Allow direct access to a dense_vector' values in script
through the following functions:

- getVectorValue – returns a vector's value as an array of floats
- getMagnitude – returns a vector's magnitude

Closes #51964
Backport for #71313
2021-04-19 12:44:27 -04:00
Christoph Büscher
35c67305d4
Support fetching flattened subfields (#70916) (#71735)
Currently the `fields` API fetches the root flattened field and returns it in a
structured way in the response. In addition this change makes it possible to
directly query subfields. However, requesting flattened subfields via wildcard
patterns is not possible.

Closes #70605
2021-04-15 15:47:03 +02:00
Alan Woodward
34b13c2595 Add index-time scripts to date field mapper (#71633)
This commit allows you to set 'script' and 'on_script_error' parameters
on date field mappers, meaning that runtime date fields can be made indexed
simply by moving their definitions from the runtime section of the mappings
to the properties section.
2021-04-14 09:32:52 +01:00
Nik Everett
13a7f23ccf
Advise against dates with decimal points (#71578) (#71652)
We accept dates with a decimal point like `2113413.13241324` and parse
them *somehow*. But there are cases where we'll lose precision on those
dates, see #70085. This advises folks not to use that format. We'll
continue to accept those dates for backwards compatibility but you
should avoid using them.

Co-authored-by: Adrien Grand <jpountz@gmail.com>
2021-04-13 15:42:32 -04:00
Nik Everett
f1e5650a79
Convert parent-join example script to runtime field (backport of #71423) (#71631)
Runtime fields are much more flexible than script_fields because you
can filter and aggregate on them so we hope folks use them! This
converts the example of using a `parent_join` field in a script to a
runtime field so folks get used to seeing them and hopefully using them.

While I was editing this I took the opportunity to replace the script
with a real-ish example. Scripts that just load the field value are nice
and short but I hope no one uses them in real life because they just add
overhead when compared to accessing the field directly. So I made the
script do something.

Relates to #69291
2021-04-13 09:22:51 -04:00
Alan Woodward
5ad0001774 Add index-time scripts to IP field mapper (#71617)
This commit allows you to set 'script' and 'on_script_error' parameters
on IP field mappers, meaning that runtime IP fields can be made indexed
simply by moving their definitions from the runtime section of the mappings
to the properties section.
2021-04-13 13:56:53 +01:00
Nik Everett
db4911fa9f
Convert date_nanos example script to runtime field (backport of #71351) (#71594)
Runtime fields are much more flexible than script_fields because you
can filter and aggregate on them so we hope folks use them! This
converts the example of using a `date_nanos` field in a script to a
runtime field so folks get used to seeing them and hopefully using them.

While I was editing this I took the opportunity to replace the script
with a real-ish example. Scripts that just load the field value are nice
and short but I hope no one uses them in real life because they just add
overhead when compared to accessing the field directly. So I made the
script do something.

Relates to #69291

Co-authored-by: Adam Locke <adam.locke@elastic.co>
2021-04-12 18:12:42 -04:00
Alan Woodward
3268d449c9 Add scripts to keyword field mapper (#71555)
This commit adds script and on_script_error parameters to
keyword field mappers, allowing you to define index-time scripts
for keyword fields.
2021-04-12 16:58:51 +01:00