diff --git a/src/App.vue b/src/App.vue index 323e1f8aed4936b836c89cb4a1dc1ca2f6024843..652b8842f49da91198d942a8bad087e952c57631 100644 --- a/src/App.vue +++ b/src/App.vue @@ -148,15 +148,15 @@ export default { function(response) { 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, lang_set: new Set(), label: item.match, articles: []}) + if (! hits[0] || hits[0].word != item.match) { + hits.splice(0, 0, {q: q, lang_set: new Set(), word: 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(', ')})` + hit.label = `${hit.word} (${Array.from(hit.lang_set).join(', ')})` } }); hits.reverse() @@ -177,7 +177,7 @@ export default { this.$refs.search.value = '' document.activeElement.blur() if(event.articles){ - this.$router.push('/' + this.lang + '/w/' + event.label) + this.$router.push('/' + this.lang + '/w/' + event.word) this.search_results = event.articles this.article = {lemmas: [], body:{pronunciation: [], definitions: [], etymology: []}} history.replaceState({article: this.article, search_results: this.search_results, lang: this.lang}, '')