Skip to content

Commit

Permalink
Request unmapped fields in context view
Browse files Browse the repository at this point in the history
  • Loading branch information
Maja Grubic committed Feb 18, 2021
1 parent 261f7af commit df2f015
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function fetchAnchorProvider(indexPatterns, searchSource, useNewFieldsApi
.setField('sort', sort);
if (useNewFieldsApi) {
searchSource.removeField('fieldsFromSource');
searchSource.setField('fields', ['*']);
searchSource.setField('fields', [{ field: '*', include_unmapped: 'true' }]);
}
const response = await searchSource.fetch();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ describe('context app', function () {
const removeFieldsSpy = searchSourceStub.removeField.withArgs('fieldsFromSource');
expect(setFieldsSpy.calledOnce).toBe(true);
expect(removeFieldsSpy.calledOnce).toBe(true);
expect(setFieldsSpy.firstCall.args[1]).toEqual(['*']);
expect(setFieldsSpy.firstCall.args[1]).toEqual([{ field: '*', include_unmapped: 'true' }]);
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function fetchContextProvider(indexPatterns: IndexPatternsContract, useNewFields
const searchSource = await data.search.searchSource.create();
if (useNewFieldsApi) {
searchSource.removeField('fieldsFromSource');
searchSource.setField('fields', ['*']);
searchSource.setField('fields', [{ field: '*', include_unmapped: 'true' }]);
}
return searchSource
.setParent(undefined)
Expand Down

0 comments on commit df2f015

Please sign in to comment.