Commit Graph

924 Commits

Author SHA1 Message Date
James Rodewig a160daa5d9
[DOCS] Remove collapsible examples (#59820) (#59857)
Snippets are now visible without additional clicks.
2020-07-20 09:14:36 -04:00
James Rodewig a672a2a2d4
[DOCS] Move highlighting docs to separate page (#59768) (#59781)
Moves the highlighting docs from the deprecated 'Request Body Search'
chapter to the new subpage of the 'Run a search chapter' section.

No substantive changes were made to the content.
2020-07-17 10:57:00 -04:00
James Rodewig 0a7664e190
[DOCS] Add data streams to validate query API (#59420) (#59436) 2020-07-13 12:50:34 -04:00
James Rodewig 1402f787f8
[DOCS] Add data streams to field caps API docs (#59326) (#59340) 2020-07-09 16:54:33 -04:00
James Rodewig 6ed356ffc3
[DOCS] Replace `datatype` with `data type` (#58972) (#59184) 2020-07-07 14:59:35 -04:00
James Rodewig 225506f0e4
[DOCS] Add data streams to rank eval API docs (#59069) (#59179) 2020-07-07 14:57:35 -04:00
James Rodewig fc5b2b2be4 [DOCS] Fix `scroll` param typo 2020-07-02 08:48:07 -04:00
debadair 4471cd7527 [DOCS] Fix cannot must typo. (#58884) 2020-07-01 17:46:09 -07:00
James Rodewig 046d9eeb41 [DOCS] Make `<target>` defs consistent 2020-06-30 15:55:37 -04:00
James Rodewig 3778ca8c25
[DOCS] Add data streams to count API (#58771) (#58772) 2020-06-30 15:52:34 -04:00
James Rodewig 69d8285a28
[DOCS] Add data streams to multi search API docs (#58610) (#58622)
Makes the existing multi search API docs aware of data streams.
2020-06-26 17:32:56 -04:00
markharwood d5ac3bb87f
Field capabilities - make `keyword` a family of field types (#58315) (#58483)
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 12:32:14 +01:00
James Rodewig 64fb326637
[DOCS] Add data streams to search docs (#58278) (#58320)
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:59:00 -04:00
Jim Ferenczi 82db0b575c
Allow index filtering in field capabilities API (#57276) (#58299)
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-18 10:23:26 +02:00
James Rodewig 5e0b00f022
[DOCS] Fix routing param in search API docs (#58267) (#58288) 2020-06-17 15:19:53 -04:00
Adam Locke ad0364dc06
[DOCS] Add documentation for near real-time search (#57560) (#58138)
* 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 16:42:57 -04:00
James Rodewig d534862d41
[DOCS] Move search API's `docvalue_fields` examples (#57760) (#57989)
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 11:25:04 -04:00
James Rodewig 9bcb41a39e
[DOCS] Fix source-related search API params (#57691) (#57889)
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 13:01:17 -04:00
James Rodewig b03a83a69d
[DOCS] Fix source filtering xrefs (#57720) (#57725) 2020-06-05 09:05:30 -04:00
James Rodewig 9c7a5c7b83
[DOCS] Move source filtering examples (#57689) (#57695)
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:34:10 -04:00
James Rodewig 2104b0503c
[DOCS] Reformat whitespace in search API docs (#57667) (#57669)
Changes the search API docs to use:

* Consistent indentation in param definitions
* Two-space indentation in JSON snippets
2020-06-04 10:02:39 -04:00
Julie Tibshirani 4f4c4a8713 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:41:48 -07:00
James Rodewig 80faafdfc7
[DOCS] Add clear scroll API reference docs (#57367) (#57611) 2020-06-03 11:58:16 -04:00
James Rodewig a2e44a0c76
[DOCS] Refactor admons for multi-parameter options (#57491) (#57540)
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 12:12:29 -04:00
James Rodewig 808835ac1c
[DOCS] Add scroll API reference docs (#57153) (#57528)
Changes:

* Adds API reference docs for the scroll API
* Documents several related parameters in the search API docs
2020-06-02 10:11:12 -04:00
Julie Tibshirani e434c481dc 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:31:42 -07:00
Lisa Cawley db5bf92acf
[7.x][DOCS] Replace docdir attribute with es-repo-dir (#57489) (#57494) 2020-06-01 16:42:53 -07:00
James Rodewig 6592c3856d [DOCS] Fix deep paging recommendations
Corrects recommendation to reference the `search_after` parameter,
not API.

Also corrects a typo and whitespace inconsistencies in the search docs.
2020-06-01 18:04:04 -04:00
James Rodewig 994781ff36
[DOCS] Add search pagination docs (#56785) (#57477)
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-06-01 16:43:06 -04:00
James Rodewig ab8ae7cf25
[DOCS] Combine search API and URI search API reference docs (#55884) (#57469)
The search API and URI search pages document the same `_search` API.
This combines the documentation from each page under the search API
docs.
2020-06-01 15:53:40 -04:00
James Rodewig 50a8779c94
[DOCS] Create top-level "Search your data" page (#56058) (#57463)
**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-06-01 14:55:26 -04:00
James Rodewig 6934264162
[DOCS] Relocate `shard allocation` module content (#56535) (#57448) 2020-06-01 13:15:08 -04:00
Nik Everett 4d5be7c817
Save memory on numeric sig terms when not top (backport of #56789) (#57221)
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 12:03:28 -04:00
Théophile Helleboid - chtitux a2c6d61ed5 [DOCS] Fix typo in search API `explain` param def (#56991)
Co-authored-by: James Rodewig <james.rodewig@elastic.co>
2020-05-20 09:22:23 -04:00
James Rodewig f6d2688de2
[DOCS] Add JS client helper links to docs (#55216) (#56968)
Adds links for the Elasticsearch-js client to the bulk and scroll docs.

Co-authored-by: Tomas Della Vedova <delvedor@users.noreply.github.com>
2020-05-19 16:53:22 -04:00
Nik Everett 126619ae3c
Add list of defered aggregations to the profiler (backport of #56208) (#56682)
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 16:33:22 -04:00
James Rodewig 2be6d7b8b6
[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:29:38 -04:00
James Rodewig ea76b0c22b
[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 11:00:03 -04:00
Luca Cavanna ef66018119 [DOCS] Async search: clarify behaviour when submit returns final results (#55934)
Closes #55636
2020-05-06 10:01:23 +02:00
James Rodewig a528319827
[DOCS] Remove invalid search API query parameters (#55884) (#56212)
This is a backport of #55884 with redirects removed.

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`
* Replaces the URI search page's query parameter docs with a xref
* Updates the headings of several examples
2020-05-05 11:10:34 -04:00
James Rodewig 922a80c3f4
[DOCS] Add collapsible sections to search API response (#55887) 2020-05-04 16:57:10 -04:00
Luca Cavanna 8b05027bf0 [DOCS] Clarify async search response flags (#55574)
Relates to #55572
2020-04-29 15:22:05 +02:00
James Rodewig ddc7305ac9 [DOCS] Correct search API's timeout parm default (#55855) 2020-04-28 09:44:50 -04:00
Adrien Grand 58c3bb5ae1
Repurpose `ignore_throttled` to be only about frozen indices. (#55047) (#55852)
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 14:31:54 +02:00
James Rodewig 8d6f0f6a76 [DOCS] Document `max_concurrent_searches` default (#55116) 2020-04-15 10:04:23 -04:00
Christoph Büscher f7ea794312 [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:27:47 +01:00
Luca Cavanna ff269160af Async search: rename REST parameters (#54198)
This commit renames wait_for_completion to wait_for_completion_timeout in submit async search and get async search.
Also it renames clean_on_completion to keep_on_completion and turns around its behaviour.

Closes #54069
2020-03-26 09:40:50 +01:00
Luca Cavanna 6b457abbd3 Async search: prevent users from overriding pre_filter_shard_size (#54088)
Submit async search forces pre_filter_shard_size for the underlying search that it creates.
With this commit we also prevent users from overriding such default as part of request validation.
2020-03-24 17:06:04 +01:00
Jim Ferenczi 9e3f7f4575
Add heuristics to compute pre_filter_shard_size when unspecified (#53873) (#54007)
This commit changes the pre_filter_shard_size default from 128 to unspecified.
This allows to apply heuristics based on the request and the target indices when deciding
whether the can match phase should run or not. When unspecified, this pr runs the can match phase
automatically if one of these conditions is met:
  * The request targets more than 128 shards.
  * The request contains read-only indices.
  * The primary sort of the query targets an indexed field.
Users can opt-out from this behavior by setting the `pre_filter_shard_size` to a static value.

Closes #39835
2020-03-24 02:05:15 +01:00
Luca Cavanna 932a7e3112
Backport of async search changes (#53976)
* Get Async Search: omit _clusters section when empty (#53907)

The _clusters section is omitted by the search API whenever no remote clusters are searched. Async search should do the same, but Get Async Search returns a deserialized response, hence a weird `_clusters` section with all values set to `0` gets returned instead. In fact the recreated Clusters object is not the same object as the EMPTY constant, yet it has the same content.

This commit addresses this by changing the comparison in the `toXContent` method to not print out the section if the number of total clusters is `0`.

* Async search: remove version from response (#53960)

The goal of the version field was to quickly show when you can expect to find something new in the search response, compared to when nothing has changed. This can also be done by looking at the `_shards` section and `num_reduce_phases` returned with the search response. In fact when there has been one or more additional reduction of the results, you can expect new results in the search response. Otherwise, the `_shards` section could notify of additional failures of shards that have completed the query, but that is not a guarantee that their results will be exposed (only when the following partial reduction is performed their results will be available).

That said this commit clarifies this in the docs and removes the version field from the async search response

* Async Search: replicas to auto expand from 0 to 1 (#53964)

This way single node clusters that are green don't go yellow once async search is used, while
all the others still have one replica.

* [DOCS] address timing issue in async search docs tests (#53910)

The docs snippets for submit async search have proven difficult to test as it is not possible to guarantee that you get a response that is not final, even when providing `wait_for_completion=0`. In the docs we want to show though a proper long-running query, and its first response should be partial rather than final.

With this commit we adapt the docs snippets to show a partial response, and replace under the hood all that's needed to make the snippets tests succeed when we get a final response. Also, increased the timeout so we always get a final response.

Closes #53887
Closes #53891
2020-03-23 19:13:31 +01:00