Commit graph

658 commits

Author SHA1 Message Date
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
Luca Cavanna
29a875f693
Add support for script parameter to boolean field mapper (#71454)
Relates to #68984
2021-04-12 11:53:50 +02:00
Nhat Nguyen
5913b79dd3
Allow specify dynamic templates in bulk request (#71518)
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-10 10:14:11 -04:00
Julie Tibshirani
4205b04173 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 12:57:48 -07:00
Adam Locke
d0d5376e03
[DOCS] [7.x] Adding page for indexing runtime fields #71366 (#71431)
* [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.

* Add type to responses for 7.x
2021-04-07 13:32:33 -04:00
markharwood
754cda81bc
New queryable "_tier" metadata field (#69288) (#71123)
* New _tier metadata field that supports term, terms, exists and wildcard queries on the first data tier preference stated for an index.

Backport of 3aee4c1f1f

Closes #68135
2021-04-07 15:44:32 +01:00
Nik Everett
5964825f88
Convert boolean field example to runtime fields (backport of #71341) (#71364)
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 15:09:23 -04:00
Alan Woodward
729fbbb7cd Add note that scripted fields will reject documents with a source value in their field (#71340) 2021-04-06 14:30:47 +01:00
Adam Locke
ba8e0ac105
[DOCS] Expand examples for runtime fields in a search query (#71237) (#71256)
* 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:26:39 -04:00
James Rodewig
c757f9e4e7
[DOCS] Fix double spaces (#71082) (#71120) 2021-03-31 11:43:34 -04:00
Alan Woodward
e3b3bd20a4
Add script parameter to long and double field mappers (#69531) (#71105)
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 15:28:47 +01:00
markharwood
1575ca01a0
Search - make wildcard field use constant scoring queries for wildcard queries and caching fix (#70452) (#71043)
Backport of 2f9c731
* 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 12:57:08 +01:00
Jim Ferenczi
149fab64d7
Change default format for date_nanos field (#70463) (#70488)
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-18 16:31:52 +01:00
James Rodewig
62d6ac3ba5
[DOCs] Add tip for index_options parameter (#70450) (#70499)
Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>

Co-authored-by: yudidi <972656027@qq.com>
2021-03-17 10:43:50 -04:00
jimczi
6ad67113f0 Revert "Change default format for date_nanos field (#70463)"
This reverts commit 3bf973ae0e.
2021-03-17 12:54:43 +01:00
Jim Ferenczi
3bf973ae0e 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 12:14:24 +01:00
James Rodewig
302341a526
[DOCS] Replace put with create or update in API names (#70330) (#70421)
Co-authored-by: debadair <debadair@elastic.co>
Co-authored-by: Lisa Cawley <lcawley@elastic.co>
2021-03-15 17:16:13 -04:00
Julie Tibshirani
13946ea7e2
Move flattened field to core. (#70122)
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.

The PR also removes flattened fields from xpack usage stats now that they live
in core. The usage stats were already removed in on master, but this PR was not
backported to avoid a breaking change on 7.x. We have now clarified that usage
stats updates are not considered breaking, so it is safe to backport this
change.
2021-03-11 11:23:28 -08:00
Mayya Sharipova
f7cb422b86
Add positive_score_impact to rank_features type (#70277)
rank_features field type misses positive_score_impact parameter
that rank_feature type has. This adds this parameter.

Backport for #69994
Closes #68619
2021-03-11 06:50:36 -05:00
James Rodewig
5ae19ee8c6
[DOCS] Add guidance for mapping unstructured content (#69079) (#70098) 2021-03-08 13:14:42 -05:00
Mayya Sharipova
32c8bc4538 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 09:30:48 -05:00
Christoph Büscher
050cc41009 [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:32:36 +01:00
Nik Everett
bd4e059746 Docs: Call out that you can't update analyzer (#69889)
You can't update the `analyzer` parameter in the PUT mappings API even if
the index is closed. This adds a TIP to call that out. And adds a TIP
for `search_quote_analyzer` which you *can* update.
2021-03-03 10:33:24 -05:00
Adam Locke
55ada03040
[DOCS] [7.x] Remove beta admonition for runtime fields. (#69562) 2021-02-24 11:55:15 -05:00
Adam Locke
85d279440d
[DOCS] [7.x] Adding grok support for runtime fields. (#69308) (#69473)
* [DOCS] [7.x] Adding grok support for runtime fields. (#69308)

* [DOCS] Adding grok support for runtime fields.

* Update response.

* Adding testresponse replacements.

* Update runtime field context and add dissect.

* Fixing backslash in the response.

* Fixing testresponse.

* Incorporating review feedback.

* Updates emit and adds cross link from ES runtime fields page.

* Add missing _type to response.
2021-02-23 14:25:03 -05:00
James Rodewig
45d93d9458
[DOCS] Remove added admons (#69452) (#69454) 2021-02-23 10:48:36 -05:00
James Rodewig
08b2136d78
[DOCS] Use consistent @timestamp field name (#69435) (#69449)
Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>

Co-authored-by: Koji Kawamura <ijokarumawak@users.noreply.github.com>
2021-02-23 10:20:23 -05:00
James Rodewig
8e991932b8
[DOCS] Improve docs for geo_shape field type's circle type (#69285) (#69361) 2021-02-22 10:36:41 -05:00
Adam Locke
7a2b326147
[DOCS] Relocate scriptless runtime document (#68916) (#69144)
* Reallocate runtime document

Reallocate document `runtime-fields-scriptless` from `runtime-search-request` to `runtime-mapping-fields`

* Move runtime without script section

Move runtime without script section to under the dynamic runtime mapping section

* Fix snippet formatting and remove discrete heading.

* Update test snippet.

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

Co-authored-by: S. J. Lee <occidere@naver.com>
2021-02-17 13:16:48 -05:00