Commit graph

673 commits

Author SHA1 Message Date
Yannick Welsch
412ac1a042
Update docs that composite agg no longer uses global ords (#74754)
Follow-up to #74559
2021-07-05 11:26:30 +02:00
Adam Locke
b759c2fdd8
[DOCS] Word changes for runtime field incentives (#74769)
Incorporates feedback from #74454
2021-06-30 13:43:26 -04:00
Adam Locke
b890f9380c
[DOCS] Add performance info for runtime fields (#74454)
* [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:23:00 -04:00
James Rodewig
d4ed43c5a4
[DOCS] Remove deprecated geo_shape parameters (#74519)
* Removes docs and references for the following `geo_shape` mapping parameters:
  * `tree`
  * `tree_levels`
  * `strategy`
  * `distance_error_pct`
* Updates a related breaking change.

Relates to #70850
2021-06-29 08:52:05 -04:00
Benjamin Trent
07b336f1b0
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 07:24:54 -04:00
Christos Soulios
df941367df
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
2021-06-24 20:16:27 +03:00
Luca Cavanna
5bfdcd2ec7
[DOCS] add missing dynamic runtime option (#74294) 2021-06-21 09:13:21 -04:00
Luca Cavanna
1d88fe639b
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 14:12:43 +02:00
James Rodewig
8a899419bc [DOCS] Change multi field to multi-field 2021-06-15 11:40:03 -04:00
Daisuke Harada
fa61bf814e
Update runtime.asciidoc (#73802)
it looks typo in a few numbers there.
2021-06-07 09:36:05 -04:00
Adam Locke
e2c470abed
[DOCS] Retrieve values from flattened fields w/ runtime fields (#73630)
* [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 11:52:53 -04:00
Adam Locke
0aa0171ce1
[DOCS] 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
2021-05-27 15:18:34 -04:00
Adam Locke
89ed0c8e29
[DOCS] Expand information on using a runtime field without a script (#73219)
* [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:09:31 -04:00
James Rodewig
8ec893a425
[DOCS] Change field alias anchor (#73043) 2021-05-13 09:32:36 -04:00
James Rodewig
8dddca77aa
[DOCS] Remove and redirect frozen index overview content (#72990)
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 12:54:20 -04:00
Dominic Page
dc43d05816
docs amendment match-only-text has limited support for aggs (#72985) 2021-05-12 16:48:57 +02:00
Christoph Büscher
f34c9a8a40
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 13:27:45 +02:00
James Rodewig
bbfa090a19
[DOCS] Fix bulk API xref (#72685) 2021-05-04 11:07:19 -04:00
Ignacio Vera
4fff3788f3
Disallow creating geo_shape mappings with deprecated parameters (#70850)
With the introduction of BKD-based geo shape indexing in #32039, the prefix tree indexing method has 
been deprecated. From 8.0.0, it will not be allowed to create new mappings using deprecated parameters.
2021-04-30 11:08:58 +02:00
Adrien Grand
83113ec8d3
Add match_only_text, a space-efficient variant of text. (#66172)
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 08:41:47 +02:00
Mayya Sharipova
f8215e752c
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:56:05 -04:00
Alan Woodward
ee3510b766
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:24:25 +01:00
Luca Cavanna
d8057bfe71
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 09:59:42 +02:00
Mayya Sharipova
853e68dfdf
Add access to dense_vector values (#71313)
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
2021-04-19 08:02:05 -04:00
Christoph Büscher
948d02e4d6
Support fetching flattened subfields (#70916)
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 12:28:58 +02:00
Alan Woodward
05551dd77b
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:18:05 +01:00
Nik Everett
6607a48435
Advise against dates with decimal points (#71578)
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:11:05 -04:00
Nik Everett
b2caf4d230
Convert parent-join example script to runtime field (#71423)
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:00:18 -04:00
Alan Woodward
67db2538f8
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:40:10 +01:00
Nik Everett
e4451bda05
Convert date_nanos example script to runtime field (#71351)
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 17:22:02 -04:00
Alan Woodward
5e11709693
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:46:02 +01:00
Luca Cavanna
1469e18c98
Add support for script parameter to boolean field mapper (#71454)
Relates to #68984
2021-04-12 10:04:12 +02:00
Julie Tibshirani
3da738e5db
Support fetching _tier field value (#71379)
Now that the `fields` option allows fetching metadata fields, we can support
loading the new `_tier` metadata field.

Relates to #63569 and #68135.
2021-04-08 11:41:52 -07:00
Nhat Nguyen
5c9969250d
Allow specify dynamic templates in bulk request (#69948)
This change allows users to specify dynamic templates in a bulk request.

```
PUT myindex
{
  "mappings": {
    "dynamic_templates": [{
      "time_histograms": {
        "mapping": {
          "type": "histogram",
          "meta": {
            "unit": "s"
          }
        }
      }
    }]
  }
}
```

```
POST myindex/_bulk
{ "index": { "dynamic_templates": { "response_times": "time_histograms" } } }
{ "@timestamp": "2020-08-12", "response_times": { "values": [1, 10], "counts": [5, 1] }}
```

Closes #61939
2021-04-08 12:44:36 -04:00
Adam Locke
343c52c19f
[DOCS] Adding page for indexing runtime fields (#71366)
* [DOCS] Adding page for indexing runtime fields

* Fixing tests.

* Incorporating review feedback to enhance and improve examples.

* Changing note to indicate immutable script when indexing, plus adding on_script_error.
2021-04-07 13:07:39 -04:00
Nik Everett
e158bc10b1
Convert boolean field example to runtime fields (#71341)
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 `boolean` 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-06 14:42:44 -04:00
Alan Woodward
98c9a95e12
Add note that scripted fields will reject documents with a source value in their field (#71340) 2021-04-06 14:28:20 +01:00
Adam Locke
14aba7bcff
[DOCS] Expand examples for runtime fields in a search query (#71237)
* Add warning admonition for removing runtime fields.

* Add cross-link to runtime fields.

* Expanding examples for runtime fields in a search request.

* Clarifying language and simplifying response tests.
2021-04-02 15:00:54 -04:00
markharwood
3aee4c1f1f
New queryable "_tier" metadata field (#69288)
New _tier metadata field that supports term, terms, exists and wildcard queries on the first data tier preference stated for an index.

Closes #68135
2021-03-31 15:37:37 +01:00
James Rodewig
693807a6d3
[DOCS] Fix double spaces (#71082) 2021-03-31 09:57:47 -04:00
Alan Woodward
1653f2fe91
Add script parameter to long and double field mappers (#69531)
This commit adds a script parameter to long and double fields that makes
it possible to calculate a value for these fields at index time. It uses the same
script context as the equivalent runtime fields, and allows for multiple index-time
scripted fields to cross-refer while still checking for indirection loops.
2021-03-31 11:14:11 +01:00
markharwood
2f9c7318c2
Search - make wildcard field use constant scoring queries for wildcard queries and caching fix (#70452)
* Make wildcard field use constant scoring queries for wildcard queries. Add a note about ignoring rewrite parameters on wildcard queries.

Also fixes caching issue where case sensitive and case insensitive results were cached as the same

Closes #69604
2021-03-30 10:37:39 +01:00
James Rodewig
d8a78b9d26
[DOCs] Add tip for index_options parameter (#70450) (#70498)
Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>

Co-authored-by: yudidi <972656027@qq.com>
2021-03-17 10:43:41 -04:00
Jim Ferenczi
701abc6bea
Change default format for date_nanos field (#70463)
This commit updates the default format of date_nanos field
on existing and new indices to use `strict_date_optional_time_nanos` instead of
`strict_date_optional_time`.
Using `strict_date_optional_time` as the default format for date_nanos doesn't
make sense because it accepts and parses dates with nanosecond precision,
but when it formats it drops the nanoseconds.
The change should be transparent for users, these formats accept the same input.

Relates #69192
Closes #67063
2021-03-17 11:40:32 +01:00
James Rodewig
5c75d004fa
[DOCS] Replace put with create or update in API names (#70330)
Co-authored-by: debadair <debadair@elastic.co>
Co-authored-by: Lisa Cawley <lcawley@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2021-03-15 14:49:44 -04:00
Mayya Sharipova
1de0b616eb
Add positive_score_impact to rank_features type (#69994)
rank_features field type misses positive_score_impact parameter
that rank_feature type has. This adds this parameter.

Closes #68619
2021-03-10 14:55:54 -05:00
Julie Tibshirani
796284a190
Move flattened field to core. (#68780)
This field mapper only lived in its own module so it could be licensed as x-pack
basic. Now it can be moved to core, which matches its status as a core type.
2021-03-08 16:56:16 -08:00
James Rodewig
f1e911d13d
[DOCS] Add guidance for mapping unstructured content (#69079) 2021-03-08 12:31:42 -05:00
Mayya Sharipova
aab3f3021a
Remove size of dense_vector (#70024)
Remove not completely correct statement about the size of dense_vectors

We do store a dense_vector as binary doc value  with size `4*dims+4`.
But this is size before compression. As compressed size depends on
data itself, it is better to remove completely any statement
about the size.
2021-03-08 07:49:06 -05:00
Christoph Büscher
6011d99b14
[DOCS] Improve tip about updating search_analyzer (#69621)
The tip about updating a `search_analyzer` currently does not mention that most
of the time (when the current analyzer is not "default"), user need to repeat
the currently set "analyzer" parameter in the field definition. Adding this as a
short note.
2021-03-03 16:31:29 +01:00