diff --git a/src/App.vue b/src/App.vue index 9f33d03ea8ce786de7641aa9c774bb4f31a82bbc..323e1f8aed4936b836c89cb4a1dc1ca2f6024843 100644 --- a/src/App.vue +++ b/src/App.vue @@ -149,10 +149,16 @@ export default { let hits = q.length ? [{q: q, label: q + ' (fritekstsøk)'}] : [] response.data.forEach((item, i) => { if (! hits[0] || hits[0].label != item.match) { - hits.splice(0, 0, {q: q, label: item.match, articles: []}) + hits.splice(0, 0, {q: q, lang_set: new Set(), label: item.match, articles: []}) } + hits[0].lang_set.add(item.dictionary == 'bob' ? 'bm' : 'nn') hits[0].articles.push(item) }); + hits.forEach(function (hit) { + if (hit.lang_set) { + hit.label += ` (${Array.from(hit.lang_set).join(', ')})` + } + }); hits.reverse() resolve(hits.slice(0, 10)) })