Commit Graph

932 Commits

Author SHA1 Message Date
James Rodewig 69899dc2cc
[DOCS] Add data streams to validate query API (#59420) 2020-07-13 12:30:54 -04:00
James Rodewig aa6cb874b9
[DOCS] Add data streams to field caps API docs (#59326) 2020-07-09 16:41:10 -04:00
James Rodewig 2be9db01c8
[DOCS] Replace `datatype` with `data type` (#58972) 2020-07-07 13:52:10 -04:00
James Rodewig 03d90c4945
[DOCS] Add data streams to rank eval API docs (#59069) 2020-07-07 13:16:53 -04:00
James Rodewig 9af4c1aa0e [DOCS] Fix `scroll` param typo 2020-07-02 08:43:45 -04:00
debadair 92851b422f
[DOCS] Fix cannot must typo. (#58884) 2020-07-01 17:44:35 -07:00
James Rodewig c7ca1d5941 [DOCS] Make `<target>` defs consistent 2020-06-30 15:53:32 -04:00
James Rodewig 3d77914db7
[DOCS] Add data streams to count API (#58771) 2020-06-30 15:01:37 -04:00
James Rodewig a7aa3da3bf
[DOCS] Add data streams to multi search API docs (#58610)
Makes the existing multi search API docs aware of data streams.
2020-06-26 17:06:58 -04:00
markharwood cdc1be144b
Field capabilities - make `keyword` a family of field types (#58315)
Introduces a new method on `MappedFieldType` to return a family type name which defaults to the field type.
Changes `wildcard` and `constant_keyword` field types to return `keyword` for field capabilities.

Relates to #53175
2020-06-24 11:37:16 +01:00
James Rodewig f00c8abe20
[DOCS] Add data streams to search docs (#58278)
Changes:

* Adds additional examples to the `Search a data stream` section of
  `Use a data stream`
* Updates existing search docs to make them aware of data streams
2020-06-18 08:43:02 -04:00
Jim Ferenczi 90c9b95ca0
Allow index filtering in field capabilities API (#57276)
* Add index filtering in field capabilities API

This change allows to use an `index_filter` in the
field capabilities API. Indices are filtered from
the response if the provided query rewrites to `match_none`
on every shard:

````
GET metrics-*
{
  "index_filter": {
    "bool": {
      "must": [
        "range": {
          "@timestamp": {
            "gt": "2019"
          }
        }
      }
  }
}
````

The filtering is done on a best-effort basis, it uses the can match phase
to rewrite queries to `match_none` instead of fully executing the request.
The first shard that can match the filter is used to create the field
capabilities response for the entire index.

Closes #56195
2020-06-17 22:53:53 +02:00
James Rodewig c0191eb84c
[DOCS] Fix routing param in search API docs (#58267) 2020-06-17 15:05:20 -04:00
Adam Locke 961a85e1e6
[DOCS] Add documentation for near real-time search (#57560)
* Adding documentation for near real-time search.

* Adding link to NRT topic and clarifying some text.

* Adding diagrams and incorporating changes from David T.
2020-06-15 14:49:33 -04:00
James Rodewig 7826bbee87
[DOCS] Move search API's `docvalue_fields` examples (#57760)
Changes:

* Condenses and relocates the `docvalue_fields` example to the 'Run a search' 
   page.
* Adds docs for the `docvalue_fields` request body parameter.
* Updates several related xrefs.

Co-authored-by: debadair <debadair@elastic.co>
2020-06-11 10:57:15 -04:00
James Rodewig 0d081de7ad
[DOCS] Fix source-related search API params (#57691)
Cleans up the reference documentation for the following
search API parameters:

* `_source` query parameter
* `_source_excludes` query parameter
* `_source_includes` query parameter
* `_source` request body parameter
* `hits._source` response property
2020-06-09 12:44:57 -04:00
James Rodewig 51e3d5ab63
[DOCS] Fix source filtering xrefs (#57720) 2020-06-05 08:46:26 -04:00
James Rodewig 7f201d7f4f
[DOCS] Move source filtering examples (#57689)
Moves the source filtering example snippets form the "Request body
search" API docs page to the "Return fields in a search" section of the
"Run a search" page.
2020-06-04 15:10:18 -04:00
James Rodewig 09980ca517
[DOCS] Reformat whitespace in search API docs (#57667)
Changes the search API docs to use:

* Consistent indentation in param definitions
* Two-space indentation in JSON snippets
2020-06-04 09:47:18 -04:00
Julie Tibshirani de9b91fe48
Add a reference on returning fields during a search. (#57500)
This PR adds a section to the new 'run a search' reference that explains
the options for returning fields. Previously each option was only listed as a
separate request parameter and it was hard to know what was available.
2020-06-03 09:33:26 -07:00
James Rodewig 69b79d21fe
[DOCS] Add clear scroll API reference docs (#57367) 2020-06-03 11:42:43 -04:00
James Rodewig 3bb11cf269
[DOCS] Refactor admons for multi-parameter options (#57491)
Several APIs support options that can be specified as a query parameter or a
request body parameter.

Currently, this is documented using notes, which can get rather lengthy. This
replaces those multiple notes with a single note and a footnote.
2020-06-02 11:58:46 -04:00
James Rodewig 0496f9ab3b
[DOCS] Add scroll API reference docs (#57153)
Changes:

* Adds API reference docs for the scroll API
* Documents several related parameters in the search API docs
2020-06-02 09:33:11 -04:00
Julie Tibshirani f46b04956b
Avoid unnecessary use of stored_fields in our docs. (#57488)
Generally we don't advocate for using `stored_fields`, and we're interested in
eventually removing the need for this parameter. So it's best to avoid using
stored fields in our docs examples when it's not actually necessary.

Individual changes:
* Avoid using 'stored_fields' in our docs.
* When defining script fields in top-hits, de-emphasize stored fields.
2020-06-01 17:29:48 -07:00
Lisa Cawley 8b9293b3bf
[DOCS] Replace docdir attribute with es-repo-dir (#57489) 2020-06-01 15:55:05 -07:00
Christoph Büscher 3d4f9fedaf
Check for negative "from" values in search request body (#54953)
Today we already disallow negative values for the "from" parameter in the search
API when it is set as a request parameter and setting it on the
SearchSourceBuilder, but it is still parsed without complaint from a search
body, leading to differing exceptions later. This PR changes this behavior to be
the same regardless of setting the value directly, as url parameter or in the
search body. While we silently accepted "-1" as meaning "unset" and used the
default value of 0 so far, any negative from-value is now disallowed.

Closes #54897
2020-05-28 16:25:19 +02:00
Nik Everett 9aaab6efdd
Save memory on numeric sig terms when not top (#56789)
This saves memory when running numeric significant terms which are not
at the top level by merging its collection into numeric terms and relying
on the optimization that we made in #55873.
2020-05-27 10:53:09 -04:00
James Rodewig 68ed00e2d2 [DOCS] Fix deep paging recommendations
Corrects recommendation to reference the `search_after` parameter,
not API.
2020-05-21 14:25:04 -04:00
Théophile Helleboid - chtitux 309d86df97
[DOCS] Fix typo in search API `explain` param def (#56991)
Co-authored-by: James Rodewig <james.rodewig@elastic.co>
2020-05-20 09:21:28 -04:00
James Rodewig 59fa4ccba3 [DOCS] Fix JS client attribute in docs
The Elasticsearch-JS client only produces documentation for major
versions (e.g., n.x, 7.x, 6.x).

However, the `{jsclient}` attribute uses the current `{branch}`, which
can result in broken links in minor version docs.

This swaps the `{jsclient}` attribute for `{jsclient-current}`,
which is less likely to break across versions.
2020-05-19 16:55:07 -04:00
Tomas Della Vedova 0e98652ed1
[DOCS] Add JS client helper links to docs (#55216)
Adds links for the Elasticsearch-js client to the bulk and scroll docs.
2020-05-19 16:17:24 -04:00
James Rodewig 56d7af09e7
[DOCS] Add search pagination docs (#56785)
Reworks the `from / size` content to `Paginate search results`.

Moves those docs from the request body search API page (slated for
deletion) to the `Run a search` tutorial docs.

Also adds some notes to the `from` and `size` param docs.

Co-authored-by: debadair <debadair@elastic.co>
2020-05-15 17:22:40 -04:00
James Rodewig 34dd9d1772 [DOCS] Correct typo in "Run a search" docs 2020-05-13 10:14:49 -04:00
Nik Everett 4a8d93f55b
Add list of defered aggregations to the profiler (#56208)
This adds a few things to the `breakdown` of the profiler:
* `histogram` aggregations now contain `total_buckets` which is the
  count of buckets that they collected. This could be useful when
  debugging a histogram inside of another bucketing agg that is fairly
  selective.
* All bucketing aggs that can delay their sub-aggregations will now add
  a list of delayed sub-aggregations. This is useful because we
  sometimes have fairly involved logic around which sub-aggregations get
  delayed and this will save you from having to guess.
* Aggregtations wrapped in the `MultiBucketAggregatorWrapper` can't
  accurately add anything to the breakdown. Instead they the wrapper
  adds a marker entry `"multi_bucket_aggregator_wrapper": true` so we
  can be quickly pick out such aggregations when debugging.

It also fixes a bug where `_count` breakdown entries were contributing
to the overall `time_in_nanos`. They didn't add a large amount of time
so it is unlikely that this caused a big problem, but I was there.

To support the arbitrary breakdown data this reworks the profiler so
that the `breakdown` can contain any data that is supported by
`StreamOutput#writeGenericValue(Object)` and
`XContentBuilder#value(Object)`.
2020-05-13 08:30:38 -04:00
James Rodewig 7c449319a1
[DOCS] Relocate `shard allocation` module content (#56535) 2020-05-12 08:55:57 -04:00
James Rodewig c0e8c088fc
[DOCS] Relocate request body param docs to search API docs (#56436)
Moves documentation for the following request body parameters to the
search API reference docs:

* `explain`
* `query`
* `seq_no_primary_term`
* `version`

Removes documentation for these parameters from the Request body search
page[0].

[0]: https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html
2020-05-11 11:10:44 -04:00
James Rodewig b5f219cc6f
[DOCS] Relocate search API's request body parameters (#56304)
Changes:
* Moves the document request body parameters for the search API
  from the Request body search page to the Search API reference page.

* Relocates a search request body example from the Request body search
  page to the Search API reference page.

* Adds a note to any duplicated query and request body parameters.
2020-05-07 09:50:22 -04:00
Luca Cavanna 6a69ab4a3e
[DOCS] Async search: clarify behaviour when submit returns final results (#55934)
* [DOCS] Async search: clarify behaviour when submit returns final results

Closes #55636

* reword

* iter
2020-05-06 10:00:30 +02:00
James Rodewig 7bcb4b78f7 [DOCS] Correct `track_total_hits` param default value 2020-05-05 10:50:01 -04:00
James Rodewig 759752e6f2 [DOCS] Correct `track_total_hits` param def formatting 2020-05-05 10:43:45 -04:00
James Rodewig e6542c0823
[DOCS] Combine search API and URI search API reference docs (#55884)
The search API and URI search pages document the same `_search` API.
This combines the documentation from each page under the search API
docs.

Changes:

* Adds an abbreviated title for the search API page.
* Removes the following invalid query parameters:
  * `analyzer`
  * `analyze_wildcard`
  * `default_operator`
  * `df`
  * `lenient`
  * `suggest_mode`
  * `suggest_size`
* Removes the URI search docs page and adds a related redirect.
* Updates the headings of several examples

Co-authored-by: debadair <debadair@elastic.co>
2020-05-05 10:28:13 -04:00
James Rodewig a73fef3d62
[DOCS] Create top-level "Search your data" page (#56058)
* [DOCS] Create top-level "Search your data" page

**Goal**

Create a top-level search section. This will let us clean up our search
API reference docs, particularly content from [`Request body search`][0].

**Changes**

* Creates a top-level `Search your data` page. This page is designed to
  house concept and tutorial docs related to search.

* Creates a `Run a search` page under `Search your data`. For now, This
  contains a basic search tutorial. The goal is to add content from
  [`Request body search`][0] to this in the future.

* Relocates `Long-running searches` and `Search across clusters` under
  `Search your data`. Increments several headings in that content.

* Reorders the top-level TOC to move `Search your data` higher. Also
  moves the `Query DSL`, `EQL`, and `SQL access` chapters immediately
  after.

Relates to #48194

[0]: https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html
2020-05-05 09:46:29 -04:00
James Rodewig 5572ccebae
[DOCS] Add collapsible sections to search API response (#55887) 2020-05-04 16:32:19 -04:00
Luca Cavanna c04bf6e14a
[DOCS] Clarify async search response flags (#55574)
Relates to #55572
2020-04-29 15:21:26 +02:00
James Rodewig 26f1851ce0
[DOCS] Correct search API's timeout parm default (#55855) 2020-04-28 09:43:52 -04:00
Adrien Grand b614412569
Repurpose `ignore_throttled` to be only about frozen indices. (#55047)
This has no practical impact on users since frozen indices are the only
throttled indices today. However this has an impact on upcoming features
that would use search throttling.

Filtering out throttled indices made sense a couple years ago, but as
we're now improving support for slow requests with `_async_search` and
exploring ways to reduce storage costs, this feature has most likely
become a trap, that we'd like to not have with upcoming features that
would use search throttling.

Relates #54058
2020-04-28 13:43:35 +02:00
James Rodewig 4980ea7596
[DOCS] Document `max_concurrent_searches` default (#55116) 2020-04-15 10:02:33 -04:00
Julie Tibshirani 13053c6ad9
Remove the object format for indices_boost. (#55078)
This format has been deprecated since version 5.2.
2020-04-14 21:01:07 -07:00
Christoph Büscher 7b199dbcec
[Test] Don't expect specific scores in docs tests (#54297)
The failing suggester documentation test was expecting specific scores in the
test response, which is fragile implementation details that e.g. can change with
different lucene versions and generally shouldn't be done in documentation test.
Instead we usually replace the float values in the output response by the ones
in the actual response.

Closes #54257
2020-03-27 10:23:16 +01:00
David Turner 10f19703e8
Mute test failing in #54257 (#54258) 2020-03-26 11:10:00 +00:00