Skip to content

Commit

Permalink
Popularize fields when adding a filter
Browse files Browse the repository at this point in the history
  • Loading branch information
weltenwort committed May 16, 2017
1 parent bcc4eb2 commit ef09aa6
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -8,7 +8,7 @@ import {
} from './constants';


export function QueryParameterActionsProvider(Private) {
export function QueryParameterActionsProvider(courier, Private) {
const filterManager = Private(FilterManagerProvider);

const setPredecessorCount = (state) => (predecessorCount) => (
Expand Down Expand Up @@ -46,9 +46,11 @@ export function QueryParameterActionsProvider(Private) {
)
);

const addFilter = (state) => (field, values, operation) => {
const addFilter = (state) => async (field, values, operation) => {
const indexPatternId = state.queryParameters.indexPatternId;
filterManager.add(field, values, operation, indexPatternId);
const indexPattern = await courier.indexPatterns.get(indexPatternId);
indexPattern.popularizeField(field.name, 1);
};

return {
Expand Down

0 comments on commit ef09aa6

Please sign in to comment.