Skip to content
Merged
Changes from 1 commit
Commits
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
8 changes: 8 additions & 0 deletions Services/dataset.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,18 @@ const search = async (searchText, filters, options) => {

// Rename return fields and highlights according to mappings
const content = Object.keys(DATASET_SEARCH_RETURN_MAPPING).reduce((acc, key) => {
if (!ds._source || !ds._source.hasOwnProperty(key)) {
return acc;
}

acc[DATASET_SEARCH_RETURN_MAPPING[key]] = ds._source[key];
return acc;
}, {});
const highlight = Object.keys(DATASET_SEARCH_RETURN_MAPPING).reduce((acc, key) => {
if (!ds.highlight || !ds.highlight.hasOwnProperty(key)) {
return acc;
}

acc[DATASET_SEARCH_RETURN_MAPPING[key]] = ds.highlight[`${key}.search`];
return acc;
}, {});
Expand Down
Loading