Skip to content

Commit

Permalink
Merge branch 'main' into version/plugin-descriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
williamrandolph committed Oct 18, 2023
2 parents 861727b + 49d3baa commit 7481f55
Show file tree
Hide file tree
Showing 249 changed files with 3,158 additions and 1,437 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@

import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.bulk.BulkResponse;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.IndexScopedSettings;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsFilter;
import org.elasticsearch.plugin.noop.action.bulk.NoopBulkAction;
import org.elasticsearch.plugin.noop.action.bulk.RestNoopBulkAction;
import org.elasticsearch.plugin.noop.action.bulk.TransportNoopBulkAction;
import org.elasticsearch.plugin.noop.action.search.NoopSearchAction;
import org.elasticsearch.plugin.noop.action.search.RestNoopSearchAction;
import org.elasticsearch.plugin.noop.action.search.TransportNoopSearchAction;
import org.elasticsearch.plugins.ActionPlugin;
Expand All @@ -31,11 +32,15 @@
import java.util.function.Supplier;

public class NoopPlugin extends Plugin implements ActionPlugin {

public static final ActionType<SearchResponse> NOOP_SEARCH_ACTION = new ActionType<>("mock:data/read/search", SearchResponse::new);
public static final ActionType<BulkResponse> NOOP_BULK_ACTION = new ActionType<>("mock:data/write/bulk", BulkResponse::new);

@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
return Arrays.asList(
new ActionHandler<>(NoopBulkAction.INSTANCE, TransportNoopBulkAction.class),
new ActionHandler<>(NoopSearchAction.INSTANCE, TransportNoopSearchAction.class)
new ActionHandler<>(NOOP_BULK_ACTION, TransportNoopBulkAction.class),
new ActionHandler<>(NOOP_SEARCH_ACTION, TransportNoopSearchAction.class)
);
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.util.concurrent.EsExecutors;
import org.elasticsearch.index.shard.ShardId;
import org.elasticsearch.plugin.noop.NoopPlugin;
import org.elasticsearch.tasks.Task;
import org.elasticsearch.transport.TransportService;

Expand All @@ -31,7 +32,7 @@ public class TransportNoopBulkAction extends HandledTransportAction<BulkRequest,

@Inject
public TransportNoopBulkAction(TransportService transportService, ActionFilters actionFilters) {
super(NoopBulkAction.NAME, transportService, actionFilters, BulkRequest::new, EsExecutors.DIRECT_EXECUTOR_SERVICE);
super(NoopPlugin.NOOP_BULK_ACTION.name(), transportService, actionFilters, BulkRequest::new, EsExecutors.DIRECT_EXECUTOR_SERVICE);
}

@Override
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.client.internal.node.NodeClient;
import org.elasticsearch.plugin.noop.NoopPlugin;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestChunkedToXContentListener;
Expand Down Expand Up @@ -38,6 +39,6 @@ public String getName() {
@Override
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) {
SearchRequest searchRequest = new SearchRequest();
return channel -> client.execute(NoopSearchAction.INSTANCE, searchRequest, new RestChunkedToXContentListener<>(channel));
return channel -> client.execute(NoopPlugin.NOOP_SEARCH_ACTION, searchRequest, new RestChunkedToXContentListener<>(channel));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.common.util.concurrent.EsExecutors;
import org.elasticsearch.plugin.noop.NoopPlugin;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.SearchHits;
import org.elasticsearch.search.aggregations.InternalAggregations;
Expand All @@ -32,7 +33,7 @@ public class TransportNoopSearchAction extends HandledTransportAction<SearchRequ
@Inject
public TransportNoopSearchAction(TransportService transportService, ActionFilters actionFilters) {
super(
NoopSearchAction.NAME,
NoopPlugin.NOOP_SEARCH_ACTION.name(),
transportService,
actionFilters,
(Writeable.Reader<SearchRequest>) SearchRequest::new,
Expand Down
7 changes: 7 additions & 0 deletions docs/changelog/100826.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pr: 100826
summary: Fix geo tile bounding boxes to be consistent with arithmetic method
area: Geo
type: bug
issues:
- 92611
- 95574
6 changes: 6 additions & 0 deletions docs/changelog/100911.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 100911
summary: '`WaitForSnapshotStep` verifies if the index belongs to the latest snapshot
of that SLM policy'
area: ILM+SLM
type: bug
issues: []
6 changes: 6 additions & 0 deletions docs/changelog/101001.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 101001
summary: "ESQL: Support date and time intervals as input params"
area: ES|QL
type: bug
issues:
- 99570
5 changes: 5 additions & 0 deletions docs/changelog/101012.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 101012
summary: Adjust `DateHistogram's` bucket accounting to be iteratively
area: Aggregations
type: bug
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/101024.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 101024
summary: More consistent logging messages for snapshot deletion
area: Snapshot/Restore
type: bug
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/101032.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 101032
summary: Throw when wrapping rate agg in `DeferableBucketAggregator`
area: TSDB
type: bug
issues: []
4 changes: 3 additions & 1 deletion docs/reference/esql/esql-rest.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ s|Description

|smile
|application/smile
|{wikipedia}/Smile_(data_interchange_format)[Smile] binary data format similar
|{wikipedia}/Smile_(data_interchange_format)[Smile] binary data format similar
to CBOR

|===
Expand Down Expand Up @@ -220,6 +220,7 @@ POST /_query
| WHERE page_count > 300 AND author == "Frank Herbert"
| STATS count = COUNT(*) by year
| WHERE count > 0
| LIMIT 5
"""
}
----
Expand All @@ -239,6 +240,7 @@ POST /_query
| WHERE page_count > ? AND author == ?
| STATS count = COUNT(*) by year
| WHERE count > ?
| LIMIT 5
""",
"params": [300, "Frank Herbert", 0]
}
Expand Down
12 changes: 6 additions & 6 deletions docs/reference/esql/multivalued-fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ POST /mv/_bulk?refresh
POST /_query
{
"query": "FROM mv"
"query": "FROM mv | LIMIT 2"
}
----

Expand Down Expand Up @@ -65,7 +65,7 @@ POST /mv/_bulk?refresh
POST /_query
{
"query": "FROM mv"
"query": "FROM mv | LIMIT 2"
}
----

Expand Down Expand Up @@ -106,7 +106,7 @@ POST /mv/_bulk?refresh
POST /_query
{
"query": "FROM mv"
"query": "FROM mv | LIMIT 2"
}
----

Expand Down Expand Up @@ -148,7 +148,7 @@ POST /mv/_bulk?refresh
POST /_query
{
"query": "FROM mv | EVAL b=TO_STRING(b)"
"query": "FROM mv | EVAL b=TO_STRING(b) | LIMIT 2"
}
----

Expand Down Expand Up @@ -183,7 +183,7 @@ POST /mv/_bulk?refresh
POST /_query
{
"query": "FROM mv | EVAL b + 2, a + b"
"query": "FROM mv | EVAL b + 2, a + b | LIMIT 4"
}
----

Expand Down Expand Up @@ -217,7 +217,7 @@ Work around this limitation by converting the field to single value with one of:
----
POST /_query
{
"query": "FROM mv | EVAL b=MV_MIN(b) | EVAL b + 2, a + b"
"query": "FROM mv | EVAL b=MV_MIN(b) | EVAL b + 2, a + b | LIMIT 4"
}
----
// TEST[continued]
Expand Down
8 changes: 5 additions & 3 deletions docs/reference/release-notes/8.10.0.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ first. If you cannot repair the repository in this way, first delete all the
snapshots in the repository taken with version 8.9.0 or later. To do this will
require using a cluster running version 8.10.0 or later.
+
If you wish to downgrade to a version in the 8.9 series, you must take or
delete a snapshot using a cluster running version 8.11.0 or later to repair the
repository format first.
If you wish to downgrade to a version in the 8.9 series, you must take or delete
a snapshot using a cluster running version 8.11.0 or later to repair the
repository format first. If you cannot repair the repository in this way, first
delete all the snapshots in the repository taken with version 8.10.0 or later
using a cluster running version 8.10.4.
// end::repositorydata-format-change[]

[[breaking-8.10.0]]
Expand Down
24 changes: 24 additions & 0 deletions docs/reference/release-notes/8.10.4.asciidoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
[[release-notes-8.10.4]]
== {es} version 8.10.4

[[known-issues-8.10.4]]
[float]
=== Known issues

* Snapshot-based downgrades
+
The snapshot repository format changed in a manner that prevents earlier
versions of Elasticsearch from reading the repository contents if it contains
snapshots from this version and the last cluster to write to this repository was
in the 8.10 series. This will prevent you from reverting an upgrade to the 8.10
series by restoring a snapshot taken before the upgrade.
+
Snapshot repositories written by clusters running versions 8.11.0 and later are
compatible with all earlier versions. Moreover, clusters running version 8.11.0
or later will also automatically repair the repository format the first time
they write to the repository to take or delete a snapshot, making it so that all
earlier versions can read its contents again.
+
If you wish to downgrade to a version prior to 8.10.0, take or delete a snapshot
using a cluster running version 8.11.0 or later to repair the repository format
first. If you cannot repair the repository in this way, first delete all the
snapshots in the repository taken with version 8.10.0 or later using a cluster
running version 8.10.4.

Also see <<breaking-changes-8.10,Breaking changes in 8.10>>.

[[bug-8.10.4]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,10 @@ GET my-index/_search
The result is the top 10 documents that are closest in meaning to your query
text from the `my-index` index sorted by their relevancy. The result also
contains the extracted tokens for each of the relevant search results with their
weights.
weights. Tokens are learned associations capturing relevance, they are not
synonyms. To learn more about what tokens are, refer to
{ml-docs}/ml-nlp-elser.html#elser-tokens[this page]. It is possible to exclude
tokens from source, refer to <<save-space,this section>> to learn more.

[source,consol-result]
----
Expand Down Expand Up @@ -325,12 +328,14 @@ by using the <<include-exclude,source exclude>> mapping to remove the ELSER
terms from the document source.

WARNING: Reindex uses the document source to populate the destination index.
Once the ELSER terms have been excluded from the source, they cannot be
recovered through reindexing. Excluding the tokens from the source is a
**Once the ELSER terms have been excluded from the source, they cannot be**
**recovered through reindexing.** Excluding the tokens from the source is a
space-saving optimsation that should only be applied if you are certain that
reindexing will not be required in the future! It's important to carefully
consider this trade-off and make sure that excluding the ELSER terms from the
source aligns with your specific requirements and use case.
source aligns with your specific requirements and use case. Review the
<<disable-source-field>> and <<include-exclude>> sections carefully to learn
more about the possible consequences of excluding the tokens from the `_source`.

The mapping that excludes `content_embedding` from the `_source` field can be
created by the following API call:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ and the `output_field` that will contain the {infer} results.
To ingest data through the pipeline to generate tokens with ELSER, refer to the
<<reindexing-data-elser>> section of the tutorial. After you successfully
ingested documents by using the pipeline, your index will contain the tokens
generated by ELSER.
generated by ELSER. Tokens are learned associations capturing relevance, they
are not synonyms. To learn more about what tokens are, refer to
{ml-docs}/ml-nlp-elser.html#elser-tokens[this page].

// end::elser[]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
import static org.elasticsearch.search.aggregations.AggregationBuilders.topHits;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
import static org.hamcrest.Matchers.closeTo;
import static org.hamcrest.Matchers.containsString;
Expand Down Expand Up @@ -513,16 +514,15 @@ public void testGetHitsFailure() throws Exception {
.get();

QueryBuilder queryBuilder = QueryBuilders.rangeQuery("@timestamp").lte("2021-01-01T00:10:00Z");
SearchResponse response = client().prepareSearch("test")
.setQuery(queryBuilder)
.setSize(10)
.addSort("key", SortOrder.ASC)
.addSort("@timestamp", SortOrder.ASC)
.get();
assertSearchResponse(response);

response = client().prepareSearch("test").setQuery(queryBuilder).setSize(10).addAggregation(timeSeries("by_ts")).get();
assertSearchResponse(response);
assertNoFailures(
client().prepareSearch("test")
.setQuery(queryBuilder)
.setSize(10)
.addSort("key", SortOrder.ASC)
.addSort("@timestamp", SortOrder.ASC)
);
assertNoFailures(client().prepareSearch("test").setQuery(queryBuilder).setSize(10).addAggregation(timeSeries("by_ts")));

assertAcked(indicesAdmin().delete(new DeleteIndexRequest("test")).actionGet());
}
Expand Down
Loading

0 comments on commit 7481f55

Please sign in to comment.