OpenSearch/modules
Nhat Nguyen 3d69b5c41e Introduce point in time APIs in x-pack basic (#61062)
This commit introduces a new API that manages point-in-times in x-pack
basic. Elasticsearch pit (point in time) is a lightweight view into the
state of the data as it existed when initiated. A search request by
default executes against the most recent point in time. In some cases,
it is preferred to perform multiple search requests using the same point
in time. For example, if refreshes happen between search_after requests,
then the results of those requests might not be consistent as changes
happening between searches are only visible to the more recent point in
time.

A point in time must be opened before being used in search requests. The
`keep_alive` parameter tells Elasticsearch how long it should keep a
point in time around.

```
POST /my_index/_pit?keep_alive=1m
```

The response from the above request includes a `id`, which should be
passed to the `id` of the `pit` parameter of search requests.

```
POST /_search
{
    "query": {
        "match" : {
            "title" : "elasticsearch"
        }
    },
    "pit": {
            "id":  "46ToAwMDaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQNpZHkFdXVpZDIrBm5vZGVfMwAAAAAAAAAAKgFjA2lkeQV1dWlkMioGbm9kZV8yAAAAAAAAAAAMAWICBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==",
            "keep_alive": "1m"
    }
}
```

Point-in-times are automatically closed when the `keep_alive` is
elapsed. However, keeping point-in-times has a cost; hence,
point-in-times should be closed as soon as they are no longer used in
search requests.

```
DELETE /_pit
{
    "id" : "46ToAwMDaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQNpZHkFdXVpZDIrBm5vZGVfMwAAAAAAAAAAKgFjA2lkeQV1dWlkMioGbm9kZV8yAAAAAAAAAAAMAWIBBXV1aWQyAAA="
}
```

#### Notable works in this change:

- Move the search state to the coordinating node: #52741
- Allow searches with a specific reader context: #53989
- Add the ability to acquire readers in IndexShard: #54966

Relates #46523
Relates #26472

Co-authored-by: Jim Ferenczi <jimczi@apache.org>
2020-09-10 19:25:47 -04:00
..
aggs-matrix-stats Replace AggregatorTestCase#search with AggregatorTestCase#searchAndReduce (#60816) 2020-08-10 17:23:00 +02:00
analysis-common Do not create two loggers for DeprecationLogger backport(#58435) (#61530) 2020-08-26 16:04:02 +02:00
geo Add search `fields` parameter to support high-level field retrieval. (#60258) 2020-07-28 10:58:20 -07:00
ingest-common Configurable output format for date processor (#61324) (#62175) 2020-09-09 11:11:02 -05:00
ingest-geoip Replace immediate task creations by using task avoidance api (#60071) (#60504) 2020-07-31 13:09:04 +02:00
ingest-user-agent Do not create two loggers for DeprecationLogger backport(#58435) (#61530) 2020-08-26 16:04:02 +02:00
kibana Simplify adding plugins and modules to testclusters (#61886) 2020-09-03 19:37:46 -07:00
lang-expression upgrade to lucene-8.7.0-snapshot-b313618cc1d (#62213) (#62222) 2020-09-10 16:23:18 +02:00
lang-mustache Do not create two loggers for DeprecationLogger backport(#58435) (#61530) 2020-08-26 16:04:02 +02:00
lang-painless [7.x] Remove integTest task from PluginBuildPlugin (#61879) (#62135) 2020-09-09 14:25:41 -05:00
mapper-extras Add specific test for serializing all mapping parameter values (#61844) (#61877) 2020-09-03 09:20:26 +01:00
parent-join Introduce point in time APIs in x-pack basic (#61062) 2020-09-10 19:25:47 -04:00
percolator Convert RangeFieldMapper to parametrized form (#62058) 2020-09-08 18:44:13 +01:00
rank-eval Simplify adding plugins and modules to testclusters (#61886) 2020-09-03 19:37:46 -07:00
reindex Simplify adding plugins and modules to testclusters (#61886) 2020-09-03 19:37:46 -07:00
repository-url [7.x] Introduce javaRestTest source set/task and convert modules (#59939) (#60026) 2020-07-28 08:39:11 -05:00
systemd [7.x] Remove integTest task from PluginBuildPlugin (#61879) (#62135) 2020-09-09 14:25:41 -05:00
transport-netty4 Merge test runner task into RestIntegTest (7.x backport) (#60600) 2020-08-04 14:46:32 +02:00
build.gradle Apply 2-space indent to all gradle scripts (#49071) 2019-11-14 11:01:23 +00:00