[data.search] Remove deprecated courier:batchSearches advanced setting (#109350)

* [data.search] Handle warnings inside of headers

* Update docs

* Add tests

* Remove isWarningResponse

* Remove deprecated courier:batchSearches advanced setting

* Update docs

* Remove legacy tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Lukas Olson 2021-08-23 09:31:13 -07:00 committed by GitHub
parent de846fb07e
commit 0a8d42c80b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 7 additions and 640 deletions

View file

@ -12,6 +12,5 @@ export default function ({ loadTestFile }: FtrProviderContext) {
describe('search', () => {
loadTestFile(require.resolve('./search'));
loadTestFile(require.resolve('./bsearch'));
loadTestFile(require.resolve('./msearch'));
});
}

View file

@ -1,77 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest');
describe('msearch', () => {
describe('post', () => {
it('should return 200 when correctly formatted searches are provided', async () =>
await supertest
.post(`/internal/_msearch`)
.send({
searches: [
{
header: { index: 'foo' },
body: {
query: {
match_all: {},
},
},
},
],
})
.expect(200));
it('should return 400 if you provide malformed content', async () =>
await supertest
.post(`/internal/_msearch`)
.send({
foo: false,
})
.expect(400));
it('should require you to provide an index for each request', async () =>
await supertest
.post(`/internal/_msearch`)
.send({
searches: [
{ header: { index: 'foo' }, body: {} },
{ header: {}, body: {} },
],
})
.expect(400));
it('should not require optional params', async () =>
await supertest
.post(`/internal/_msearch`)
.send({
searches: [{ header: { index: 'foo' }, body: {} }],
})
.expect(200));
it('should allow passing preference as a string', async () =>
await supertest
.post(`/internal/_msearch`)
.send({
searches: [{ header: { index: 'foo', preference: '_custom' }, body: {} }],
})
.expect(200));
it('should allow passing preference as a number', async () =>
await supertest
.post(`/internal/_msearch`)
.send({
searches: [{ header: { index: 'foo', preference: 123 }, body: {} }],
})
.expect(200));
});
});
}