Commit graph

758 commits

Author SHA1 Message Date
Mark Laney
fe2ec6c916 Remove any mention of "mapping type" (#86242)
Mapping types were removed in v6.0 so they shouldn't be mentioned in the
description of inheritance of the `dynamic` setting.
2022-09-27 16:47:11 +02:00
Nik Everett
eec7ba4737
Put synthetic source back in tech preview (#90371)
I got some new this morning that we're going to have to rework how we
handle ignore-above in synthetic _source which makes me a bit weary of
removing tech-preview in 8.5. I asked a few folks and they felt more
comfortable giving it a little longer in tech preview. I expect until
ignore-above is in.
2022-09-27 02:15:04 +09:30
Nik Everett
d0cf9f5034
Synthetic _source: ignore_malformed for ip (#90038)
This adds synthetic `_source` support for `ip` fields with
`ignore_malfored` set to `true`. We save the field values in hidden
stored field, just like we do for `ignore_above` keyword fields. Then we
load them at load time.
2022-09-26 09:28:55 -04:00
Alan Woodward
d507a4982c
Add line to meta param docs explaining limits on use (#90300) 2022-09-23 16:19:28 +01:00
Christoph Büscher
4ae17d2dc6 Docs: Fix small typo in runtime.asciidoc (#90194)
A small grammar fix.
2022-09-22 11:34:27 +02:00
Nik Everett
17967a98d3
Remove synthetic _source from tech preview (#90042)
I've been hacking on synthetic source for a while now and not seen any
need to break backwards compatibility or any major bugs. I think it's
time to remove the `preview` marker from it so folks can use it without
fear.
2022-09-13 16:33:10 -04:00
Alan Woodward
224f48e637
[DOCS] document that date and date_nanos fields support synthetic source (#89968) 2022-09-09 17:21:43 +01:00
Christos Soulios
1a709caa65 [TSDB] Removed summary and histogram metric types (#89937)
It seems that for now we don't have a good use for the histogram and summary metric types. 
They had been left as place holders for a while, but at this point there is no concrete plan forward for them.

This PR removes the histogram and summary metric types. We may add them back in the future.

Also, this PR completely removes the time_series_metric mapping parameter from the histogram field type and only allows the gauge metric type for aggregate_metric_double fields.
2022-09-09 15:04:30 +03:00
Nik Everett
c4a77d572d
Synthetic _source: support dense_vector (#89840)
This adds support for synthetic _source to `dense_vector` fields.

![image](https://user-images.githubusercontent.com/215970/188734496-0f0772c7-4c7a-46b6-b978-0c220e73474d.png)
2022-09-09 00:54:59 +09:30
Nik Everett
e89586c20d
Document synthetic source for text and keyword (#89893)
`text` and `keyword` fields support synthetic _source in a few more
configurations now. This documents those configurations.
2022-09-08 23:35:27 +09:30
Nik Everett
b667aa33f0
Synthetic _source: support histogram field (#89833)
Adds support for the `histogram` field type to synthetic _source.

![image](https://user-images.githubusercontent.com/215970/188691249-9d23d1dc-64ab-49a4-8b24-f60fc966c0ac.png)
2022-09-08 01:55:38 +09:30
Nik Everett
104f4e9fb5
Synthetic _source: support version field type (#89706)
This adds support for synthetic _source to the `version` field type. It
works very similarly to `keyword` but with an extra decode step.

I modified the decoder to return a `BytesRef` instead of a `String`
because many of the callers seemed to be converting that string directly
into bytes again. Synthetic source would have wanted to do that. As was
the query infrastructure.
2022-08-30 09:39:50 -04:00
Abdon Pijpelink
e891909dfa
[DOCS] Explain dynamic behavior for unmapped copy_to fields (#89626)
* [DOCS] Explain dynamic behavior for unmapped copy_to fields

* Review suggestions
2022-08-30 15:15:35 +02:00
David Kilfoyle
2a44a8982f
[DOCS] Remove feature flag from TSDS docs (#89673)
* Docs: Remove feature flag and add preview label to TSDS docs

* Fix technical preview tag
2022-08-29 10:33:55 -04:00
Nik Everett
914e216ebd
Prepare synthetic source docs for tech-preview (#89358)
Now that we're releasing synthetic _source as a tech preview feature, we
no longer want to remove the docs from the non-release builds. And we
want to mark all of the headings describing synthetic `_source` as a
preview.
2022-08-16 10:05:45 -04:00
Nik Everett
2569d1f08d
Docs: synthetic source doesn't dedupe numbers (#89355)
The docs for synthetic `_source` incorrectly claimed that synthetic
`_source` deduplicates numbers. It doesn't. The example below the prose
shows it *not* removing duplicates.
2022-08-16 07:28:46 +09:30
Mayya Sharipova
10b804730d
Include runtime fields in total fields count (#89251)
We have a check that enforces the total number of fields needs to be below a
certain (configurable) threshold. Before runtime fields did not contribute
to the count. This patch makes all runtime fields contribute to the
count, runtime fields:
- that were explicitly defined in mapping by a user
- as well as runtime fields that were dynamically created by dynamic
 mappings

Closes #88265
2022-08-15 09:43:12 -04:00
Luca Belluccini
2d3bcc483d
[DOCS] Warn only one date format is added to the field date formats when using dynamic_date_formats (#88915)
* [DOCS] Warn only one date format is added to the field date formats

When using multiple options in `dynamic_date_formats`, only one of the formats of the first document having a date matching one of the date formats provided will be used.

E.g.
```
PUT my-index-000001
{
  "mappings": {
    "dynamic_date_formats": [ "yyyy/MM", "MM/dd/yyyy"]
  }
}

PUT my-index-000001/_doc/1
{
  "create_date": "09/25/2015"
}
```

The generated mappings will be:
```
    "mappings": {
      "dynamic_date_formats": [
        "yyyy/MM",
        "MM/dd/yyyy"
      ],
      "properties": {
        "create_date": {
          "type": "date",
          "format": "MM/dd/yyyy"
        }
      }
    },
```

Indexing a document with `2015/12` would lead to the `format` `"yyyy/MM"` being used for the `create_date`.

This can be misleading especially if the user is using multiple date formats on the same field.
The first document will determine the format of the `date` field being detected.

Maybe we should provide an additional example, such as:
```
PUT my-index-000001
{
  "mappings": {
    "dynamic_date_formats": [ "yyyy/MM||MM/dd/yyyy"]
  }
}
```

My wording is not great, so feel free to amend/edit.

* Update docs/reference/mapping/dynamic/field-mapping.asciidoc

Reword and add code example

* Turned discussion of the two syntaxes into an admonition

* Fix failing tests

Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>
2022-08-11 10:43:53 +02:00
Abdon Pijpelink
b96c39e7ad
[DOCS] Move completion type asciidoc (#89086)
* [DOCS] Move completion type asciidoc

* Fix failing code snippet test
2022-08-04 10:02:28 +02:00
Christos Soulios
ad2dc834a7
Add synthetic_source support to aggregate_metric_double fields (#88909)
This PR implements synthetic_source support to the aggregate_metric_double
field type

Relates to #86603
2022-08-01 20:42:25 +03:00
Gilad Gal
c35cfc9fca
Update synthetic-source.asciidoc (#88880)
* Update synthetic-source.asciidoc

* Update docs/reference/mapping/fields/synthetic-source.asciidoc

Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>

Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>
2022-07-28 10:35:10 +03:00
Julie Tibshirani
e3ede67262
Integrate ANN into _search endpoint (#88694)
This PR adds a new `knn` option to the `_search` API to support ANN search.
It's powered by the same Lucene ANN capabilities as the old `_knn_search`
endpoint. The `knn` option can be combined with other search features like
queries and aggregations.

Addresses #87625
2022-07-22 08:02:07 -07:00
Alan Woodward
5c11a81913
Add 'mode' option to _source field mapper (#88211)
Currently we have two parameters that control how the source of a document
is stored, `enabled` and `synthetic`, both booleans. However, there are only
three possible combinations of these, with `enabled:false` and `synthetic:true`
being disallowed. To make this easier to reason about, this commit replaces
the `enabled` parameter with a new `mode` parameter, which can take the values
`stored`, `synthetic` and `disabled`. The `mode` parameter cannot be set
in combination with `enabled`, and we will subsequently move towards
deprecating `enabled` entirely.
2022-07-18 12:50:10 +01:00
David Kilfoyle
992344a3fc
[Docs] Fix runtime grok script example (#87851)
* [Docs] Fix runtime grok script example

* Update runtime.asciidoc

Small fix.

* Update runtime.asciidoc

Small fix...

* Update common-script-uses.asciidoc

Small fix.

* Update docs/reference/scripting/common-script-uses.asciidoc

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

Co-authored-by: Adam Locke <adam.locke@elastic.co>
2022-07-05 10:53:24 -04:00
Jingguo Yao
2309eb2c2d
Fix a typo in date format docs (#87018)
The example dates have the day parts of the month instead of the day parts of the week.
2022-07-05 12:15:13 +02:00
Luca Cavanna
7ee737ec01
Specify how to add fields from _source from a script (#88150)
Co-authored-by: freiit <freiit@users.noreply.github.com>
2022-07-05 11:54:36 +02:00
David Kilfoyle
40e9f3097c
[DOCS] Add TSDS docs, take two (#87703)
* Revert "Revert "[DOCS] Add TSDS docs (#86905)" (#87702)"

This reverts commit 0c86d7b9b2.

* First fix to tests

* Add data_stream object to index template

* small rewording

* Add enable data stream object in gradle example setup

* Add bullet about data stream must be enabled in template
2022-06-16 12:44:10 -04:00
David Kilfoyle
0c86d7b9b2
Revert "[DOCS] Add TSDS docs (#86905)" (#87702)
Reverts elastic/elasticsearch#86905
2022-06-15 13:32:12 -04:00
David Kilfoyle
d57f4ac2c6
[DOCS] Add TSDS docs (#86905)
* [DOCS] Add TSDB docs

* Update docs/build.gradle

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

* Address Nik's comments, part 1

* Address Nik's comments, part deux

* Reword write index

* Add feature flags

* Wrap one more section in feature flag

* Small fixes

* set index.routing_path to optional

* Update storage reduction value

* Update create index template code example

Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
Co-authored-by: Adam Locke <adam.locke@elastic.co>
2022-06-15 12:22:07 -04:00
Nik Everett
b18bafb207
Docs for synthetic source (#87416)
This adds some basic docs for synthetic source both to get us started
documenting it and to show how I'd like to get it documented - with a
central section in the docs for `_source` and "satellite" sections in
each of the supported field types that link back to the central section.

[Preview](https://elasticsearch_87416.docs-preview.app.elstc.co/guide/en/elasticsearch/reference/master/mapping-source-field.html#synthetic-source)
2022-06-09 09:42:06 -04:00
Nik Everett
5079f4ff45
Document example loss of precision from floats (#87122)
This adds an example of the precision loss for `double`, `float`, and
`half_float` numbers that we can link folks to when explaining what
happened to their numbers. You can link directly to it with something
like:
```
/guide/number.html#floating_point
```
2022-05-25 16:45:23 -04:00
Craig Taverner
5f7ea792ac
Soft-deprecation of point/geo_point formats (#86835)
* Soft-deprecation of point/geo_point formats

Since GeoJSON and WKT are now common formats for all three types:
  geo_shape, geo_point and point
We decided to soft-deprecate the other point formats by ordering:
* GeoJSON (object with keys `type` and `coordinates`)
* WKT `POINT(x y)`
* Object with keys `lat` and `lon` (or `x` and `y` for point)
* Array [lon,lat]
* String `"lat,lon"` (or `"x,y"` in point)
* String with geohash (only in `geo_point`)

The geohash is last because it is only in one field type.
The string version is second last because it is the most controversial
being the only version to reverse the coordinate order from all other
formats (for geo_point only, since the coordinates are not reversed
in point).

In addition we replaced many examples in both documentation and tests
to prioritize WKT over the plain string format.

Many remaining examples of array format or object with keys still exist
and could be replaced by, for example, GeoJSON, if we feel the need.

* Incorrect quote position
2022-05-17 23:46:43 +02:00
Luca Cavanna
d45b19db18
Add support for dots in field names for metrics usecases (#86166)
This PR adds support for a new mapping parameter to the configuration of the object mapper (root as well as individual fields), that makes it possible to store metrics data where it's common to have fields with dots in their names in the following format:

```
{
  "metrics.time" : 10,
  "metrics.time.min" : 1,
  "metrics.time.max" : 500
}
```

Instead of expanding dotted paths the their corresponding object structure, objects can be configured to preserve dots in field names, in which case they can only hold leaf sub-fields and no further objects.

The mapping parameter is called subobjects and controls whether an object can hold other objects (defaults to true) or not. The following example shows how it can be configured in the mappings:

```
{
  "mappings" : {
    "properties" : {
      "metrics" : {
        "type" : "object", 
        "subobjects" : false
      }
    }
  }
}
```

Closes #63530
2022-05-17 16:34:39 +02:00
Adam Locke
7db1c807f2
Fix a linebreak (#86739) (#86742)
(cherry picked from commit 5ee3bbaa79)

Co-authored-by: Ugo Sangiorgi <ugo.sangiorgi@elastic.co>
2022-05-12 11:04:57 -04:00
Craig Taverner
68f432275d
Added documentation on GeoJSON format for points and geo-points (#86066)
* Added documentation on GeoJSON format for points

And geo-points.

* Fixed some small mistakes in painless geo-point
2022-04-28 10:41:07 +02:00
Mayya Sharipova
1eeee8e84f
Clarify max number of dims for indexed vectors (#85002) 2022-03-17 10:32:46 +00:00
Julie Tibshirani
95be11f6fb
Clarify docs on field type families (#84368)
There has been some confusion over the definition of a field type family. This
PR clarifies the definition in the docs: the two types should have the exact
same search behavior (including supporting the same queries/ aggs, and producing
the same response). It's not sufficient for them to just support the samme
search operations.

This change also fixes an inaccurate statement that there is only one field type
family so far.
2022-02-24 13:27:36 -08:00
Nhat Nguyen
31d703f24c
Introduce lookup runtime fields (#82385)
This PR introduces the lookup runtime fields which are used to retrieve 
data from the related indices. The below search request enriches its
search hits with the location of each IP address from the `ip_location`
index.

```
POST logs/_search
{
  "runtime_mappings": {
    "location": {
      "type": "lookup",
      "lookup_index": "ip_location",
      "query_type": "term",
      "query_input_field": "ip",
      "query_target_field": "_id",
      "fetch_fields": [
        "country",
        "city"
      ]
    }
  },
  "fields": [
    "timestamp",
    "message",
    "location"
  ]
}
```

Response:

```
{
  "hits": {
    "hits": [
      {
        "_index": "logs",
        "_id": "1",
        "fields": {
          "location": [
            {
              "city": [ "Montreal" ],
              "country": [ "Canada" ]
            }
          ],
          "message": [ "the first message" ]
        }
      }
    ]
  }
}
```
2022-02-22 21:36:19 -05:00
Yannick Welsch
083bb8a3fd
Add extra section on doc-value-only fields to documentation (#84209)
Adds a dedicated section for doc-value-only fields to the docs that can be linked to.
2022-02-22 11:46:10 +01:00
James Rodewig
6ad3f8bfdd
[DOCS] Clarify orientation usage for WKT and GeoJSON polygons (#84025)
Clarifies that the `orientation` mapping parameter only applies to WKT polygons. GeoJSON polygons use a default orientation of `RIGHT`, regardless of the mapping parameter.

Also notes that the document-level `orientation` parameter overrides the default orientation for both WKT and GeoJSON polygons.

Closes https://github.com/elastic/elasticsearch/issues/84009.
2022-02-17 10:33:06 -05:00
Mayya Sharipova
bf3208b028
Add scripted_metric agg context to unsigned_long (#64422)
Also enhance documentation to provide more examples
how unsigned_long field should be used in scripts

Closes #64347
2022-02-02 15:27:42 -05:00
Yannick Welsch
7f0595abe6
Implement all queries on doc-values only keyword fields (#83404)
Adds doc-values-only search support for wilcard/regexp/prefix/fuzzy etc. queries on keyword fields.

Relates #81210 and #52728
2022-02-02 14:06:27 +01:00
Yannick Welsch
eec26826d6
Allow doc-values only search on geo_point fields (#83395)
Similar to #82409, but for geo_point fields.

Allows searching on geo_point fields when those fields are not indexed (index: false) but just doc values are enabled.

Also adds distance feature query support for date fields (bringing date field to feature parity with runtime fields)

This enables searches on archive data, which has access to doc values but not index structures. When combined with
searchable snapshots, it allows downloading only data for a given (doc value) field to quickly filter down to a select set
of documents.

Relates #81210 and #52728
2022-02-02 11:56:19 +01:00
Adam Locke
620fe44c6b
[DOCS] Update dynamic mapping docs to clarify supported match_mapping_type (#83274)
* [DOCS] Update dynamic mapping docs to clarify supported match_mapping_type

* Add ES data type column header

* Remove sentence about always choosing the larger data type

* Clarify that JSON doesn't distinguish types

* Add frame to table
2022-02-01 10:37:27 -05:00
Julie Tibshirani
e7ba03e0a6
Add notes on indexing to kNN search guide (#83188)
This change adds a new 'indexing considerations' section that explains why index
calls can be slow and how force merge can help search latency.
2022-01-28 10:23:35 -08:00
Mitar
b65fb17a48 Fixed documentation for built in date formats. (#83036)
We had a lot of `ZZ` on the end of formats. But it's just `Z`.
2022-01-26 14:22:02 -05:00
James Rodewig
d3fb014914
[DOCS] Reuse multi-level join warning (#82976)
Updates and reuses a warning against creating multi-level `join` fields to make it more prominent.

The current warning is low on the page, where some users may not seeing until they've already begun mapping fields.

Closes https://github.com/elastic/elasticsearch/issues/82818.
2022-01-25 13:51:42 -05:00
Yannick Welsch
d9f77fa3a6
Allow doc-values only search on ip fields (#82929)
Allows searching on ip fields when those fields are not indexed (index: false) but just doc values are enabled.

This enables searches on archive data, which has access to doc values but not index structures. When combined with
searchable snapshots, it allows downloading only data for a given (doc value) field to quickly filter down to a select set
of documents.

Relates #81210 and #52728
2022-01-25 09:24:12 +01:00
Yannick Welsch
0592c4cd7e
Allow doc-values only search on boolean fields (#82925)
Allows searching on boolean fields when those fields are not indexed (index: false) but just doc values are enabled.

This enables searches on archive data, which has access to doc values but not index structures. When combined with
searchable snapshots, it allows downloading only data for a given (doc value) field to quickly filter down to a select set
of documents.

Relates #81210 and #52728
2022-01-24 14:27:06 +01:00
Yannick Welsch
fd7f69cea6
Allow doc-values only search on keyword fields (#82846)
Allows searching on keyword fields when those fields are not indexed (index: false) but just doc values are enabled.

This enables searches on archive data, which has access to doc values but not index structures. When combined with
searchable snapshots, it allows downloading only data for a given (doc value) field to quickly filter down to a select set
of documents.

Relates #81210 and #52728
2022-01-24 08:57:11 +01:00