]> _ Git - odl.git/commitdiff
wip #5122
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 23 Feb 2022 15:02:49 +0000 (16:02 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 23 Feb 2022 15:02:49 +0000 (16:02 +0100)
resources/js/search.js

index f562d5e490e0485e25ca14f7924e9addc9057f41..32a14b2047e9c05e490dd48eaad90935bd55d273 100644 (file)
@@ -9,7 +9,7 @@ export default () => ({
     miniSearch: {}, // Holds the MiniSearch instance
     setup: { // MiniSearch options: https://lucaong.github.io/minisearch/#search-options
         fields: ['title', 'text', 'keywords'], // fields to index for full-text search
-        storeFields: ['id', 'title', 'text', 'type', 'url', 'thumb'], // fields to return with search results
+        storeFields: ['id', 'displayedTitle', 'text', 'type', 'url', 'thumb'], // fields to return with search results
         searchOptions: {
             prefix: true, // Allow partial matches
             processTerm: (term, _fieldName) => term.length < 3 ? null : term.toLowerCase()
@@ -46,7 +46,7 @@ export default () => ({
             attributes = '@click.prevent="openPDF($el.attributes.href.value); closeSearch();"';
         }
 
-        return `<a href="${URL}" class="${classes}" ${attributes}>${result.title}</a>`;
+        return `<a href="${URL}" class="${classes}" ${attributes}>${result.displayedTitle}</a>`;
     },
 
     get results() {