}, fullQuery, true
).toPromise()
.then(result => this.applyResultData(ctx, result))
+ .then(_ => this.fetchFieldHighlights(ctx))
.then(_ => {
ctx.searchState = CatalogSearchState.COMPLETE;
this.onSearchComplete.emit(ctx);
// them to bib IDs for highlighting.
ids = ctx.currentResultIds();
if (ctx.termSearch.groupByMetarecord) {
- // TODO: at this point in loading we don't yet
- // have result records to comb through
- /*
- ids = ids.map(mrId =>
- ctx.result.records.filter(r => mrId === r.metabibId)[0].id
- );
- */
+ // The 4th slot in the result ID reports the master record
+ // for the metarecord in question. Sometimes it's null?
+ ids = ctx.result.ids.map(id => id[4]).filter(id => id !== null);
}
}