Skip to content

Commit

Permalink
Clear out old rollup strategy (elastic#59423)
Browse files Browse the repository at this point in the history
* Old search strategy cleanup

* restore rollup strategy

* Remove hasSearchStategyForIndexPattern

* ts

* fix jest tests

* cleanup exports

* pass index pattern type to server for rollups

* merge fix

* Fix types

* ts fixes

* oss strategy error handling

* update translations

* jest test fix

* Use indexType instead of index

* code review 1

* updated docs

* jest test

* jest snapshot

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
Liza Katz and elasticmachine committed Mar 11, 2020
1 parent 710111f commit a0dd3f5
Show file tree
Hide file tree
Showing 48 changed files with 129 additions and 646 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [getDefaultQuery](./kibana-plugin-plugins-data-public.getdefaultquery.md)

## getDefaultQuery() function

<b>Signature:</b>

```typescript
export declare function getDefaultQuery(language?: QueryLanguage): {
query: string;
language: QueryLanguage;
};
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| language | <code>QueryLanguage</code> | |

<b>Returns:</b>

`{
query: string;
language: QueryLanguage;
}`

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [IEsSearchRequest](./kibana-plugin-plugins-data-public.iessearchrequest.md) &gt; [indexType](./kibana-plugin-plugins-data-public.iessearchrequest.indextype.md)

## IEsSearchRequest.indexType property

<b>Signature:</b>

```typescript
indexType?: string;
```
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ export interface IEsSearchRequest extends IKibanaSearchRequest
| Property | Type | Description |
| --- | --- | --- |
| [indexType](./kibana-plugin-plugins-data-public.iessearchrequest.indextype.md) | <code>string</code> | |
| [params](./kibana-plugin-plugins-data-public.iessearchrequest.params.md) | <code>SearchParams</code> | |
Original file line number Diff line number Diff line change
Expand Up @@ -74,32 +74,26 @@
| [RangeFilterParams](./kibana-plugin-plugins-data-public.rangefilterparams.md) | |
| [RefreshInterval](./kibana-plugin-plugins-data-public.refreshinterval.md) | |
| [SavedQuery](./kibana-plugin-plugins-data-public.savedquery.md) | |
| [SavedQueryAttributes](./kibana-plugin-plugins-data-public.savedqueryattributes.md) | |
| [SavedQueryService](./kibana-plugin-plugins-data-public.savedqueryservice.md) | |
| [SearchSourceFields](./kibana-plugin-plugins-data-public.searchsourcefields.md) | |
| [SearchStrategyProvider](./kibana-plugin-plugins-data-public.searchstrategyprovider.md) | |
| [TimefilterSetup](./kibana-plugin-plugins-data-public.timefiltersetup.md) | |
| [TimeRange](./kibana-plugin-plugins-data-public.timerange.md) | |

## Variables

| Variable | Description |
| --- | --- |
| [addSearchStrategy](./kibana-plugin-plugins-data-public.addsearchstrategy.md) | |
| [baseFormattersPublic](./kibana-plugin-plugins-data-public.baseformatterspublic.md) | |
| [castEsToKbnFieldTypeName](./kibana-plugin-plugins-data-public.castestokbnfieldtypename.md) | Get the KbnFieldType name for an esType string |
| [connectToQueryState](./kibana-plugin-plugins-data-public.connecttoquerystate.md) | Helper to setup two-way syncing of global data and a state container |
| [createSavedQueryService](./kibana-plugin-plugins-data-public.createsavedqueryservice.md) | |
| [defaultSearchStrategy](./kibana-plugin-plugins-data-public.defaultsearchstrategy.md) | |
| [ES\_SEARCH\_STRATEGY](./kibana-plugin-plugins-data-public.es_search_strategy.md) | |
| [esFilters](./kibana-plugin-plugins-data-public.esfilters.md) | |
| [esKuery](./kibana-plugin-plugins-data-public.eskuery.md) | |
| [esQuery](./kibana-plugin-plugins-data-public.esquery.md) | |
| [esSearchStrategyProvider](./kibana-plugin-plugins-data-public.essearchstrategyprovider.md) | |
| [fieldFormats](./kibana-plugin-plugins-data-public.fieldformats.md) | |
| [FilterBar](./kibana-plugin-plugins-data-public.filterbar.md) | |
| [getKbnTypeNames](./kibana-plugin-plugins-data-public.getkbntypenames.md) | Get the esTypes known by all kbnFieldTypes {<!-- -->Array<string>} |
| [hasSearchStategyForIndexPattern](./kibana-plugin-plugins-data-public.hassearchstategyforindexpattern.md) | |
| [indexPatterns](./kibana-plugin-plugins-data-public.indexpatterns.md) | |
| [QueryStringInput](./kibana-plugin-plugins-data-public.querystringinput.md) | |
| [SearchBar](./kibana-plugin-plugins-data-public.searchbar.md) | |
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

6 changes: 1 addition & 5 deletions src/legacy/core_plugins/data/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ export function plugin() {

/** @public types */
export { DataSetup, DataStart } from './plugin';
export {
SavedQueryAttributes,
SavedQuery,
SavedQueryTimeFilter,
} from '../../../../plugins/data/public';
export { SavedQuery, SavedQueryTimeFilter } from '../../../../plugins/data/public';
export {
// agg_types
AggParam, // only the type is used externally, only in vis editor
Expand Down
10 changes: 1 addition & 9 deletions src/legacy/core_plugins/data/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@
*/

import { CoreSetup, CoreStart, Plugin } from 'kibana/public';
import {
DataPublicPluginStart,
addSearchStrategy,
defaultSearchStrategy,
DataPublicPluginSetup,
} from '../../../../plugins/data/public';
import { DataPublicPluginStart, DataPublicPluginSetup } from '../../../../plugins/data/public';
import { ExpressionsSetup } from '../../../../plugins/expressions/public';

import {
Expand Down Expand Up @@ -111,9 +106,6 @@ export class DataPlugin
public setup(core: CoreSetup, { data, uiActions }: DataPluginSetupDependencies) {
setInjectedMetadata(core.injectedMetadata);

// This is to be deprecated once we switch to the new search service fully
addSearchStrategy(defaultSearchStrategy);

uiActions.attachAction(
SELECT_RANGE_TRIGGER,
selectRangeAction(data.query.filterManager, data.query.timefilter.timefilter)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { PhraseFilter, IndexPattern, TimefilterSetup } from '../../../../../plugins/data/public';
import { PhraseFilter, IndexPattern, TimefilterContract } from '../../../../../plugins/data/public';
import { SearchSource as SearchSourceClass, SearchSourceFields } from '../legacy_imports';

export function createSearchSource(
Expand All @@ -27,7 +27,7 @@ export function createSearchSource(
aggs: any,
useTimeFilter: boolean,
filters: PhraseFilter[] = [],
timefilter: TimefilterSetup['timefilter']
timefilter: TimefilterContract
) {
const searchSource = initialState ? new SearchSource(initialState) : new SearchSource();
// Do not not inherit from rootSearchSource to avoid picking up time and globals
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { PhraseFilterManager } from './filter_manager/phrase_filter_manager';
import { createSearchSource } from './create_search_source';
import { ControlParams } from '../editor_utils';
import { InputControlVisDependencies } from '../plugin';
import { IFieldType, TimefilterSetup } from '../../../../../plugins/data/public';
import { IFieldType, TimefilterContract } from '../../../../../plugins/data/public';

function getEscapedQuery(query = '') {
// https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-regexp-query.html#_standard_operators
Expand Down Expand Up @@ -74,7 +74,7 @@ const termsAgg = ({ field, size, direction, query }: TermsAggArgs) => {

export class ListControl extends Control<PhraseFilterManager> {
private getInjectedVar: InputControlVisDependencies['core']['injectedMetadata']['getInjectedVar'];
private timefilter: TimefilterSetup['timefilter'];
private timefilter: TimefilterContract;

abortController?: AbortController;
lastAncestorValues: any;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { RangeFilterManager } from './filter_manager/range_filter_manager';
import { createSearchSource } from './create_search_source';
import { ControlParams } from '../editor_utils';
import { InputControlVisDependencies } from '../plugin';
import { IFieldType, TimefilterSetup } from '../.../../../../../../plugins/data/public';
import { IFieldType, TimefilterContract } from '../.../../../../../../plugins/data/public';

const minMaxAgg = (field?: IFieldType) => {
const aggBody: any = {};
Expand All @@ -52,7 +52,7 @@ const minMaxAgg = (field?: IFieldType) => {
};

export class RangeControl extends Control<RangeFilterManager> {
timefilter: TimefilterSetup['timefilter'];
timefilter: TimefilterContract;
abortController: any;
min: any;
max: any;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export {
IIndexPattern,
IndexPattern,
indexPatterns,
hasSearchStategyForIndexPattern,
IFieldType,
SearchSource,
ISearchSource,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import { DiscoverNoResults } from './no_results';
import { DiscoverUninitialized } from './uninitialized';
import { DiscoverUnsupportedIndexPattern } from './unsupported_index_pattern';
import { DiscoverHistogram } from './histogram';
import { getAngularModule, wrapInI18nContext } from '../../../kibana_services';

Expand All @@ -33,8 +32,4 @@ app.directive('discoverUninitialized', reactDirective =>
reactDirective(wrapInI18nContext(DiscoverUninitialized))
);

app.directive('discoverUnsupportedIndexPattern', reactDirective =>
reactDirective(wrapInI18nContext(DiscoverUnsupportedIndexPattern), ['unsupportedType'])
);

app.directive('discoverHistogram', reactDirective => reactDirective(DiscoverHistogram));
Loading

0 comments on commit a0dd3f5

Please sign in to comment.