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

Add SearchStrategyRegistry and defaultSearchStrategy to support existing search behavior, and integrate it with CallClient. #20497

Merged
merged 32 commits into from
Jul 18, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
2bd4962
Add SearchStrategyRegistry and defaultSearchStrategy to support exist…
cjcenizal Jul 5, 2018
1c1b99a
Fix typo.
cjcenizal Jul 5, 2018
a0386ea
Move fetch param logic from CallClient into defaultSearchStrategy.
cjcenizal Jul 6, 2018
ebd3544
Move defaultSearchStrategy configuration into kibana plugin via searc…
cjcenizal Jul 6, 2018
27ba85c
Fix typo in comment.
cjcenizal Jul 6, 2018
8a7e05f
Fix bug where Dashboard Only Mode was broken.
cjcenizal Jul 6, 2018
0a8442b
Don't throw ABORTED.
cjcenizal Jul 9, 2018
9777a60
Add comments and refactor for clarity.
cjcenizal Jul 9, 2018
31925d5
Refactor strategy interface to be more flexible with the arguments it…
cjcenizal Jul 10, 2018
b74224c
Add call-out react directive.
cjcenizal Jul 10, 2018
9d02ff2
Show error in Discover if user tries to access a rollup index pattern…
cjcenizal Jul 10, 2018
d48f65b
Improve logic for resolving an early response if all searchRequests h…
cjcenizal Jul 11, 2018
bcce546
Merge branch 'master' of github.com:elastic/kibana into search-strate…
cjcenizal Jul 12, 2018
5c7666c
Fix bugs in callClient using the tests as a guide.
cjcenizal Jul 12, 2018
6b97760
Fix bug caused by typo in defaultSearchStrategy.
cjcenizal Jul 13, 2018
3964b3a
Improve appearance of Discover when an unsupported rollup index patte…
cjcenizal Jul 13, 2018
596a8c9
Remove unnecessary if.
cjcenizal Jul 13, 2018
dcddc1c
Return separate searching and abort properties from strategy.search().
cjcenizal Jul 13, 2018
00a8fe5
Simplify isViable to only expect an indexPattern.
cjcenizal Jul 13, 2018
ae033f2
Remove duplicate call to respondToSearchRequests().
cjcenizal Jul 13, 2018
5bd4b01
Send responses in original order to respondToSearchRequests.
cjcenizal Jul 13, 2018
d867a3f
Fix Jest tests.
cjcenizal Jul 13, 2018
714990c
Add tests with multiple searchStrategies and fix errors in logic.
cjcenizal Jul 13, 2018
683a2f3
Merge branch 'master' of github.com:elastic/kibana into search-strate…
cjcenizal Jul 13, 2018
5ad6a55
Rename describe block.
cjcenizal Jul 13, 2018
464b568
Rename describe block.
cjcenizal Jul 13, 2018
6d4fc57
Merge branch 'master' of github.com:elastic/kibana into search-strate…
cjcenizal Jul 16, 2018
4aba1fa
Check for default type index pattern instead of rollup type.
cjcenizal Jul 16, 2018
4c51a51
CallClient now expects search to resolve with responses array.
cjcenizal Jul 16, 2018
1c4e668
Fix tests.
cjcenizal Jul 17, 2018
ff73efb
Tweak copy.
cjcenizal Jul 17, 2018
e6379d8
Merge branch 'master' of github.com:elastic/kibana into search-strate…
cjcenizal Jul 18, 2018
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
4 changes: 1 addition & 3 deletions src/ui/public/courier/fetch/__tests__/call_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,7 @@ describe('callClient', () => {
describe('searchRequests with multiple searchStrategies map correctly to their responses', () => {
const search = ({ searchRequests }) => {
return {
searching: Promise.resolve({
responses: searchRequests.map(searchRequest => searchRequest.__testId__),
}),
searching: Promise.resolve(searchRequests.map(searchRequest => searchRequest.__testId__)),
failedSearchRequests: [],
abort: () => {},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ export const defaultSearchStrategy = {
failedSearchRequests,
} = await serializeAllFetchParams(allFetchParams, searchRequests, serializeFetchParams);

const searching = es.msearch({ body: serializedFetchParams }).then(({ responses }) => responses);
const abort = searching.abort;
const searching = es.msearch({ body: serializedFetchParams });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


return {
searching,
abort,
// Unwrap the responses object returned by the es client.
searching: searching.then(({ responses }) => responses),
abort: searching.abort,
failedSearchRequests,
};
},
Expand Down