Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A new search API for API keys - core search function #75335

Merged
merged 199 commits into from
Aug 3, 2021
Merged
Changes from 1 commit
Commits
Show all changes
199 commits
Select commit Hold shift + click to select a range
aaa8324
WIP: working version
ywangd Jul 6, 2021
6cf8bf2
Rename search to query
ywangd Jul 7, 2021
db31169
show that manage_own_api_key is tested last
ywangd Jul 11, 2021
697d25e
Merge remote-tracking branch 'origin/master' into es-71023-new-search…
ywangd Jul 14, 2021
21aa8e6
add more tests
ywangd Jul 14, 2021
bf95613
Prefer consistent request/response format for now
ywangd Jul 14, 2021
d7a6d72
Add comment for explanation
ywangd Jul 14, 2021
fb053ad
working on tests
ywangd Jul 14, 2021
67a14cb
checkstyle
ywangd Jul 14, 2021
3133622
Merge branch 'master' into es-71023-new-search-for-api-keys
elasticmachine Jul 15, 2021
e9fd594
Apply suggestions from code review
ywangd Jul 30, 2021
704cd54
Mute SimpleFeatureFactoryTests test points (#75359)
iverase Jul 15, 2021
fd7c2db
Move some constants from SearchableSnapshotsConstants to server (#75308)
tlrx Jul 15, 2021
42d3daa
[Rest Api Compatibility] Allow transforming warnings per test (#75187)
pgomulka Jul 15, 2021
2893098
Update "ssl-config" to support X-Pack features (#74887)
tvernum Jul 15, 2021
c84ec00
Introduce searchable snapshots index setting for cascade deletion of …
tlrx Jul 15, 2021
dee3b89
[ML] Rename JobNodeLoadDetectorTests to match tested class (#75370)
dimitris-athanasiou Jul 15, 2021
e8007e5
Resolve date math expressions before looking up index metadata (#75314)
danhermann Jul 15, 2021
07676e0
Add a tool for creating enrollment tokens (#74890)
jkakavas Jul 15, 2021
7bdf43e
[DOCS] Clarify usage of the enroll Kibana API (#75348)
Jul 15, 2021
c4e84e3
Remove SET aliases from disk usage and field usage YML tests (#75381)
stevejgordon Jul 15, 2021
84d4709
Add null check for shard stats to data tier telemetry (#75185)
dakrone Jul 15, 2021
65116fa
[DOCS] Fix broken doc url values in JSON API spec (#75385)
jrodewig Jul 15, 2021
b2a317f
[DOCS] Update doc URLs for trained model deployment APIs (#75388)
lcawl Jul 15, 2021
e435073
Increase client timeout on CCS tests (#75346)
bpintea Jul 15, 2021
ec509e0
Increment Iron Bank base image to 8.4
pugnascotia Jul 15, 2021
30e0bd0
Ensure system index upgrade mechanism can handle integer _meta.verion…
gwbrown Jul 15, 2021
a9356f1
Mute GeoIpDownloaderIT#testInvalidTimestamp (#75398)
probakowski Jul 15, 2021
57aa649
Fix broken test for dimension keywords (#75408)
csoulios Jul 16, 2021
4f0b4e9
Add missing X-Pack repositories REST specs (#65548)
stevejgordon Jul 16, 2021
a5d2317
[Rest Api Compatibility] Allow to use size -1 (#75342)
pgomulka Jul 16, 2021
c420119
Remove obsolete BWC in OS stats (#75376)
danhermann Jul 16, 2021
e0bc584
Fix Snapshot Out of Order Finalization Repo Corruption (#75362)
original-brownbear Jul 16, 2021
974884d
Weaken assertions in SearchWhileRelocatingIT (#75345)
ywelsch Jul 16, 2021
fe079d4
[DOCS] Adds peak_model_bytes and assignment_memory_basis to GET model…
szabosteve Jul 16, 2021
c91f08a
Remove support for configurable PKCS#11 keystores (#75404)
tvernum Jul 19, 2021
6a6cd14
Make NestedObjectMapper its own class (#74410)
romseygeek Jul 19, 2021
284dd74
ILM: execute cached steps even if policy is updated (#75296)
andreidan Jul 19, 2021
38f6db9
[Rest Api Compatibility] Do not return _doc for empty mappings in tem…
pgomulka Jul 19, 2021
f2ad596
Fix failure on attempt to overwrite multi fields (#75454)
Jul 19, 2021
20b14c6
[DOCS] Correct docs for deprecation logging (#75361)
robin13 Jul 19, 2021
023b2b6
[DOCS] Document time series dimension mapping parameters (#75414)
jrodewig Jul 19, 2021
69e3e77
Allow ILM move-to-step without `action` or `name` (#75435)
dakrone Jul 19, 2021
a54dee0
Correct XCombinedFieldQuery equals and hashCode (#75402)
jtibshirani Jul 19, 2021
41a0dc7
[DOCS] Remove leading slashes
jrodewig Jul 19, 2021
89818e3
Fix TOC order
jrodewig Jul 19, 2021
33433ac
[DOCS] Add object subfield example for update API (#75460)
jrodewig Jul 19, 2021
3a1c1e7
Disable BWC tests for ILM move-to-step backport (#75481)
dakrone Jul 19, 2021
132f333
Re-enable BWC for ILM move-to-step backport (#75498)
dakrone Jul 19, 2021
fdb8a97
Fix toXContent of PointInTimeBuilder (#75476)
dnhatn Jul 19, 2021
324330c
Make FeatureFactory tests more resilient (#75405)
iverase Jul 20, 2021
ed9699f
[Transform] Optimize composite agg execution using ordered groupings …
Jul 20, 2021
f6a339e
Add filter support to data stream aliases (#74784)
martijnvg Jul 20, 2021
5bb47e1
Reset elastic password cli tool (#74892)
jkakavas Jul 20, 2021
63894ca
[ML] Memory based trained model task allocation (#75378)
dimitris-athanasiou Jul 20, 2021
a5acac6
Enable javac warnings in x-pack identity-provider (#75450)
pugnascotia Jul 20, 2021
3612581
Enable compiler warnings for watcher (#75516)
pugnascotia Jul 20, 2021
64930e3
Fix RestSnapshotsStatusCancellationIT (#75524)
original-brownbear Jul 20, 2021
d956307
Bump version after 7.13.4 release
joegallo Jul 20, 2021
3634f42
Align XCombinedFieldQuery with latest changes (#75483)
jtibshirani Jul 20, 2021
3f7be4d
Remove deprecated date histo interval (#75000)
not-napoleon Jul 20, 2021
a68a960
Advise away from a ping schedule on remote connxns (#75513)
DaveCTurner Jul 20, 2021
1e2c933
[DOCS] Fixes nesting of datafeed config in APIs (#75502)
lcawl Jul 20, 2021
05a486e
Simplify building the default log4j2.properties (#75535)
pugnascotia Jul 20, 2021
3b1efd1
Remove MavenFilteringHack (#73637)
jakelandis Jul 20, 2021
6475bf2
Configure security for the initial node cli (#74868)
albertzaharovits Jul 21, 2021
6181a6d
Make some vector tile body parameters as query parameters (#75522)
iverase Jul 21, 2021
1e459fd
Fix the use of wildcard expressions for data streams in update aliase…
martijnvg Jul 21, 2021
4ef5157
[Rest Api Compatibility] Enable parent_join inner_hits test (#75560)
pgomulka Jul 21, 2021
a378d41
Wait for ES to finish startup during password tests (#75420)
pugnascotia Jul 21, 2021
d4b8c30
Disable bwc tests for #74784 (#75567)
martijnvg Jul 21, 2021
5a26aea
`indices.query.bool.max_clause_count` now limits all query clauses (#…
jpountz Jul 21, 2021
aa427ab
Fix RoutingTable Lookup by Index (#75530)
original-brownbear Jul 21, 2021
8449ebb
Enable bwc tests for #74784 (#75568)
martijnvg Jul 21, 2021
22609fc
Adjust graph explore api to also support data streams. (#75541)
martijnvg Jul 21, 2021
8f3e4c0
[DOCS] SQL: Add formal API docs (#75506)
jrodewig Jul 21, 2021
d6fb1c1
Significant terms test refactor for extendability (#75452)
benwtrent Jul 21, 2021
1213572
Re-enable compiler warnings in :test:framework (#75449)
pugnascotia Jul 21, 2021
3a2e081
Fix failing HTTP client stats test (#75527)
danhermann Jul 21, 2021
28765d0
Adjust skip version for data stream alias tests (#75585)
martijnvg Jul 21, 2021
06d227a
[DOCS] Retitle 'SQL access' page to 'SQL'
jrodewig Jul 21, 2021
f95d7f4
Fix Tripped Assertion on Failed Snapshot Clone Cleanup (#75582)
original-brownbear Jul 21, 2021
2076cb6
[ML] adding new p_value scoring heuristic to significant terms aggreg…
benwtrent Jul 21, 2021
572cfb7
Print suggestion to view log on fatal error (#75418)
pugnascotia Jul 21, 2021
7c97e70
SQL: Improve verifier errors on nested aggregations (#75517)
Jul 21, 2021
468a7e4
Increase docker compose timeout on ARM CI jobs
mark-vieira Jul 21, 2021
5718d49
Enable compiler warnings in x-pack security (#75473)
pugnascotia Jul 21, 2021
5979731
Mute PValueScoreTests.testLowPValueScore
mark-vieira Jul 21, 2021
249dd02
[DOCS] Fix typos
jrodewig Jul 21, 2021
b5bb1db
Fix reported branch in build scans for pull request CI jobs (#75600)
mark-vieira Jul 21, 2021
1d96037
Mute CandidateQueryTests.testPercolateSmallAndLargeDocument
mark-vieira Jul 21, 2021
f18bdb0
Add Sha256 header in elasticsearch RPMs (#75569)
breskeby Jul 22, 2021
3ccc8e3
[doc] Document workaround for slow log levels (#75438)
pgomulka Jul 22, 2021
4e44793
[Transform] fix listener for search context missing exception (#75615)
Jul 22, 2021
76a4eb3
Address recent percolator failures. (#75620)
jpountz Jul 22, 2021
10526ad
Add the ability to fetch the latest successful shard snapshot (#75080)
fcofdez Jul 22, 2021
eeb1e16
Handle runtime subfields when shadowing dynamic mappings (#75595)
romseygeek Jul 22, 2021
b67eded
Fix ConfigInitialNode certificate SAN generation (#75622)
jkakavas Jul 22, 2021
8940f97
[DOCS] Update Kibana dev console screenshots for new EUI theme (#75626)
jrodewig Jul 22, 2021
86f3f55
Mute PValueScoreTests.testHighPValueScore (#75636)
mayya-sharipova Jul 22, 2021
f5e7c51
[DOCS] Fix Watcher chapter title (#75220)
spinscale Jul 22, 2021
c707eed
[ML] make p_value scoring tests more robust (#75629)
benwtrent Jul 22, 2021
4ca2113
Create data stream aliases from template (#73867)
danhermann Jul 22, 2021
4d868f5
Fix wrong error upper bound when performing incremental reductions (#…
Hohol Jul 22, 2021
ea5e7da
[ML] Integrating ML with the node shutdown API (#75188)
droberts195 Jul 22, 2021
c9fe937
[DOC] Add ingest error metadata (#75653)
danhermann Jul 23, 2021
b3034c1
[DOCS] Reword for clarity
jrodewig Jul 23, 2021
760edcd
[DOCS] Fix typo
jrodewig Jul 23, 2021
82c0a51
Mute org.elasticsearch.search.aggregations.bucket.TermsDocCountErrorI…
original-brownbear Jul 25, 2021
4f82c21
Fix contents of license tools zip file (#75610)
tvernum Jul 26, 2021
96cd1c8
Fix Potential Memory Leak in SecurityServerTransportInterceptor (#75669)
original-brownbear Jul 26, 2021
585ddf4
[ML] Parse time_ms field from inference result (#75570)
davidkyle Jul 26, 2021
4daa6fc
Distinguish timeouts/failures in follower checker (#75519)
DaveCTurner Jul 26, 2021
fb6e850
Drop ReceiveTimeoutTransportException stack trace (#75671)
DaveCTurner Jul 26, 2021
24b95c7
[ML] fixing datafeed preview after allowing datafeed_config in job_co…
benwtrent Jul 26, 2021
3d8a80c
Add warning header after 25 days after last db update (#75311)
probakowski Jul 26, 2021
f756bc4
Update licenses and attributions for GeoIP module (#75178)
probakowski Jul 26, 2021
1c93138
[DOCS] Updates for data stream aliases (#75654)
danhermann Jul 26, 2021
5e5666f
[DOCS] Comments out link that points to outlier detection example (#7…
szabosteve Jul 26, 2021
965f80b
[Rest Api Compatibility] Voting config exclusion exception message (#…
pgomulka Jul 26, 2021
b87d8ea
unsigned longs should be compatible with index sorting (#75599)
jimczi Jul 26, 2021
7c544e5
[ML] Mute PyTorchModelIT.testEvaluate on Aarch64 (#75690)
davidkyle Jul 26, 2021
ed1f47f
[DOCS] Drafts trained model deployment APIs (#75497)
lcawl Jul 26, 2021
868ce3e
[DOCS] Update index template API docs for data stream aliases (#75688)
jrodewig Jul 26, 2021
8621a18
[DOCS] Adds ml-cpp PRs to release notes (#75703)
lcawl Jul 26, 2021
fb7f209
[DOCS] Fix formatting for 8.0 breaking changes (#75709)
jrodewig Jul 26, 2021
cdd2183
[DOCS] Fixes link in EQL breaking changes (#75710)
lcawl Jul 26, 2021
1fa2b30
[DOCS] Fix tags and xrefs for 8.0 breaking changes (#75712)
jrodewig Jul 26, 2021
be14569
[DOCS] Add tip for Kibana Fleet APIs (#75711)
EricDavisX Jul 26, 2021
6337ed2
[DOCS] Fix typo (#75635) (#75705)
jrodewig Jul 26, 2021
d6727cb
[DOCS] Relocate tip for Fleet APIs
jrodewig Jul 26, 2021
edc293a
[DOCS] Fix formatting for several 8.0 breaking changes (#75715)
jrodewig Jul 26, 2021
f9c8e70
[DOCS] Removes ml-cpp PR from release notes (#75717)
lcawl Jul 26, 2021
f972d71
Fix license check failures on Windows
mark-vieira Jul 27, 2021
8a024fe
Vector tiles: Add support for Geometry collections (#75697)
iverase Jul 27, 2021
93cfe87
[DOCS] Adds p-value heuristic to significant terms aggregation (#75369)
szabosteve Jul 27, 2021
d1d92b6
ILM ClusterStateWaitThresholdBreachTests cycles due to `shrunk-shards…
andreidan Jul 27, 2021
8f255a0
[Transform] Fix transform fails when getting field mappings (#75694)
Jul 27, 2021
656b7af
Fix testConcurrentRestoreDeleteAndClone Timing Issue (#75523)
original-brownbear Jul 27, 2021
d3a9d7d
Include reason in cancellation exceptions (#75332)
DaveCTurner Jul 27, 2021
4b818e5
[Rest Api Compatibility] Licence accept_enterprise and response chang…
pgomulka Jul 27, 2021
43e691e
Use reader wrapper in ReadOnlyEngine (#75724)
ywelsch Jul 27, 2021
793e4ae
Fix testConcurrentRestoreDeleteAndClone Corner Case (#75728)
original-brownbear Jul 27, 2021
95d344d
[ML] notify inference listeners of pytorch process crash (#75679)
benwtrent Jul 27, 2021
f59c50b
Allow specifying index in pinned queries (#74873)
Jul 27, 2021
57f786f
Fix Concurrent Snapshot Repository Corruption from Operations Queued …
original-brownbear Jul 27, 2021
88440e1
Remove usage of deprecated JavaPluginConvention (#75106)
breskeby Jul 27, 2021
b803b8f
Update rpm build to add sha256 payload and file digest (#75731)
breskeby Jul 27, 2021
5592757
Adding shard count to node stats api (#75433)
masseyke Jul 27, 2021
1d15402
Adjust version checks after pinned query backport
jtibshirani Jul 27, 2021
0e8ae9e
Enhance Shard Level Metdata check in BlobStoreTestUtil (#75737)
original-brownbear Jul 27, 2021
839ed48
Make PublishPlugin gradle configuration cache compliant (#74828)
breskeby Jul 27, 2021
bccca8b
Vector tiles: order hits by geometry size by default (#75621)
iverase Jul 27, 2021
db5af7d
Fix dependency report link to JDK sources (#75742)
mark-vieira Jul 27, 2021
026a7ef
[DOCS] Update ingest pipeline screenshots for new EUI theme (#75744)
jrodewig Jul 27, 2021
5be6f6d
Set netty available processors system property for tests globally (#7…
mark-vieira Jul 27, 2021
2c98ba0
Fix compiler warnings in :server - part 1 (#75708)
pugnascotia Jul 27, 2021
328f5c6
[DOCS] Update index management screenshots for new EUI theme (#75754)
jrodewig Jul 27, 2021
8d9d552
[DOCS] Remove unneeded screenshot from 'Size your shards' docs
jrodewig Jul 27, 2021
f95e171
Fix the usage of CacheIteratorHelper for service account (#75510)
ywangd Jul 28, 2021
d1e107e
Add 'mvt' field type format to geo fields (#75367)
iverase Jul 28, 2021
f082ebc
Remove incorrect assertion in CollapsingTopDocsCollectorSearchAfterTests
jtibshirani Jul 27, 2021
bb163a4
Refactor SSL setup in X-Pack (#75410)
tvernum Jul 28, 2021
19c801d
New release notes generator tasks (#71125)
pugnascotia Jul 28, 2021
657d476
Refactor plugin CLI commands (#75259)
pugnascotia Jul 28, 2021
f018dc1
[Rest Api Compatibility] Deprecate the use of synced flush (#75372)
pgomulka Jul 28, 2021
61acc54
Disabling BWC tests for _nodes/stats shard count backport (#75787)
masseyke Jul 28, 2021
5499267
[Transform][Rollup] remove unnecessary list indirection (#75459)
Jul 28, 2021
0c43ff9
Re-enabling BWC tests, and updating supported versions for shard coun…
masseyke Jul 28, 2021
ae9bd01
Avoid running all EQL BWC tasks when running check (#75743)
mark-vieira Jul 28, 2021
76897cd
Removing local abort availability checks (#75785)
droberts195 Jul 28, 2021
8a014da
[ML] Mute PyTorchModelIT in advance of input format changes (#75800)
davidkyle Jul 28, 2021
968233f
[ML] fixing potential network thread lockup on Pytorch model load (#7…
benwtrent Jul 28, 2021
1d68b8f
[DOCS] Fixes bulleted list in ML aggregations (#75806)
lcawl Jul 28, 2021
6bac600
[DOCS] Steps for updating TLS certificates (#73781)
Jul 28, 2021
4c37c47
Ensure we still test older operating systems where supported
mark-vieira Jul 28, 2021
f4e2b1f
Fix Jenkins job configuration syntax
mark-vieira Jul 28, 2021
681ead0
Remove Jenkins matrix job combination filter
mark-vieira Jul 28, 2021
0e08be9
Fix privileges for GetRollupIndexCapabilities API (#75614)
ywangd Jul 29, 2021
f3ae991
Remove usage of RAM accounting of segments (#75674)
jpountz Jul 29, 2021
81ad470
Docs: ILM document behaviour for changing lifecycle setting (#75790)
andreidan Jul 29, 2021
1776cec
[ML] Don't try to respond to shutdown API when disabled (#75828)
droberts195 Jul 29, 2021
10d361e
Make Authentication/Authorization Stacks Shallower/Simpler (#75662)
original-brownbear Jul 29, 2021
9fedd01
[ML] fix count ks test aggregator test consistency (#75793)
benwtrent Jul 29, 2021
dead681
[ML] throttle job audit msgs if delayed data occurs for consecutive b…
benwtrent Jul 29, 2021
ed7b27b
[ML] Delete expired annotations (#75617)
przemekwitek Jul 29, 2021
d036ed0
[DOCS] 8.0.0-alpha1 release notes
jakelandis Jul 29, 2021
bbf4c94
[ML] disable bwc for backporting new Job setting (system_annotations_…
przemekwitek Jul 29, 2021
8dd1deb
[ML] Adapt wire serialization code and re-enable BWC tests after back…
przemekwitek Jul 29, 2021
43229bf
Properly apply `system` flag on data streams when restoring a snapsho…
gwbrown Jul 29, 2021
a8d63ad
Add SLES 15 SP3 to docker exclusion list
mark-vieira Jul 29, 2021
4af8008
fix imports
ywangd Jul 30, 2021
cab9797
Merge remote-tracking branch 'origin/master' into es-71023-new-search…
ywangd Jul 30, 2021
810d8ef
Merge remote-tracking branch 'origin/master' into es-71023-new-search…
ywangd Jul 30, 2021
598d4f8
address feedback
ywangd Jul 30, 2021
786daad
Address feedback for checking query API key action.
ywangd Jul 30, 2021
8be55cb
fix test
ywangd Jul 30, 2021
6bf40fa
Address feedback to add javadoc
ywangd Aug 3, 2021
072e02e
Merge branch 'master' into es-71023-new-search-for-api-keys
elasticmachine Aug 3, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[Rest Api Compatibility] Allow to use size -1 (#75342)
previously disallowed in #70209. However since now the recommendation is
to not set the field at all - and rely on a default - this would be a
shape change for users prefering to set -1 so far.
With request compatible with v7 they will still be allowed to do this
and will get a warning.

relates #69548
relates #51816
  • Loading branch information
pgomulka authored and ywangd committed Jul 30, 2021
commit a5d231715462834a5f45fbaca6eb81d1f423cb67
1 change: 0 additions & 1 deletion rest-api-spec/build.gradle
Original file line number Diff line number Diff line change
@@ -97,7 +97,6 @@ tasks.named("yamlRestCompatTest").configure {
'search.aggregation/200_top_hits_metric/top_hits aggregation with sequence numbers',
'search.aggregation/51_filter_with_types/Filter aggs with terms lookup and ensure it\'s cached',
'search/150_rewrite_on_coordinator/Ensure that we fetch the document only once', //terms_lookup
'search/260_parameter_validation/test size=-1 is deprecated', //size=-1 change
'search/310_match_bool_prefix/multi_match multiple fields with cutoff_frequency throws exception', //cutoff_frequency
'search/340_type_query/type query', // type_query - probably should behave like match_all
] + v7compatibilityNotSupportedTests())
Original file line number Diff line number Diff line change
@@ -16,12 +16,12 @@
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.core.Booleans;
import org.elasticsearch.core.RestApiVersion;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.core.Booleans;
import org.elasticsearch.core.RestApiVersion;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestRequest;
@@ -207,7 +207,16 @@ private static void parseSearchSource(final SearchSourceBuilder searchSourceBuil
}
if (request.hasParam("size")) {
int size = request.paramAsInt("size", SearchService.DEFAULT_SIZE);
setSize.accept(size);
if (request.getRestApiVersion() == RestApiVersion.V_7 && size == -1) {
// we treat -1 as not-set, but deprecate it to be able to later remove this funny extra treatment
deprecationLogger.compatibleApiWarning(
"search-api-size-1",
"Using search size of -1 is deprecated and will be removed in future versions. "
+ "Instead, don't use the `size` parameter if you don't want to set it explicitly."
);
} else {
setSize.accept(size);
}
}

if (request.hasParam("explain")) {
@@ -303,7 +312,7 @@ static void preparePointInTime(SearchRequest request, RestRequest restRequest, N
assert request.pointInTimeBuilder() != null;
ActionRequestValidationException validationException = null;
if (request.indices().length > 0) {
validationException = addValidationError("[indices] cannot be used with point in time. Do " +
validationException = addValidationError("[indices] cannot be used with point in time. Do " +
"not specify any index with point in time.", validationException);
}
if (request.indicesOptions().equals(DEFAULT_INDICES_OPTIONS) == false) {
Original file line number Diff line number Diff line change
@@ -10,23 +10,23 @@

import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.Version;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.core.Booleans;
import org.elasticsearch.core.Nullable;
import org.elasticsearch.common.xcontent.ParseField;
import org.elasticsearch.common.ParsingException;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.core.RestApiVersion;
import org.elasticsearch.core.TimeValue;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.common.xcontent.ParseField;
import org.elasticsearch.common.xcontent.ToXContentFragment;
import org.elasticsearch.common.xcontent.ToXContentObject;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentHelper;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.core.Booleans;
import org.elasticsearch.core.Nullable;
import org.elasticsearch.core.RestApiVersion;
import org.elasticsearch.core.TimeValue;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.QueryRewriteContext;
import org.elasticsearch.index.query.Rewriteable;
@@ -1121,7 +1121,17 @@ public void parseXContent(XContentParser parser, boolean checkTrailingTokens) th
if (FROM_FIELD.match(currentFieldName, parser.getDeprecationHandler())) {
from(parser.intValue());
} else if (SIZE_FIELD.match(currentFieldName, parser.getDeprecationHandler())) {
size(parser.intValue());
int parsedSize = parser.intValue();
if (parser.getRestApiVersion() == RestApiVersion.V_7 && parsedSize == -1) {
// we treat -1 as not-set, but deprecate it to be able to later remove this funny extra treatment
deprecationLogger.compatibleApiWarning(
"search-api-size-1",
"Using search size of -1 is deprecated and will be removed in future versions. "
+ "Instead, don't use the `size` parameter if you don't want to set it explicitly."
);
} else {
size(parsedSize);
}
} else if (TIMEOUT_FIELD.match(currentFieldName, parser.getDeprecationHandler())) {
timeout = TimeValue.parseTimeValue(parser.text(), null, TIMEOUT_FIELD.getPreferredName());
} else if (TERMINATE_AFTER_FIELD.match(currentFieldName, parser.getDeprecationHandler())) {
Original file line number Diff line number Diff line change
@@ -484,6 +484,14 @@ public void testNegativeSizeErrors() throws IOException {
IllegalArgumentException ex = expectThrows(IllegalArgumentException.class, () -> SearchSourceBuilder.fromXContent(parser));
assertThat(ex.getMessage(), containsString(Integer.toString(randomSize)));
}

restContent = "{\"size\" : -1}";
try (XContentParser parser = createParserWithCompatibilityFor(JsonXContent.jsonXContent, restContent, RestApiVersion.V_7)) {
SearchSourceBuilder searchSourceBuilder = SearchSourceBuilder.fromXContent(parser);
assertEquals(-1, searchSourceBuilder.size());
}
assertWarnings("Using search size of -1 is deprecated and will be removed in future versions. Instead, don't use the `size` "
+ "parameter if you don't want to set it explicitly.");
}

public void testNegativeTerminateAfter() throws IOException {