From 8292987e0abe126c0345b3d34fab2b2e4cee0474 Mon Sep 17 00:00:00 2001 From: buttle Date: Wed, 24 Nov 2021 13:20:08 +0100 Subject: [PATCH] includes local title data in search --- src/components/search.vue | 4 ---- src/store.js | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/search.vue b/src/components/search.vue index f885e8e..eaeaa51 100644 --- a/src/components/search.vue +++ b/src/components/search.vue @@ -38,10 +38,6 @@ export default { }, methods: { search: function() { - if (this.search_text==="") { - return - } - console.log(this.search_text) this.setSearchText(this.search_text) var local_search_result = this.searchLocalSiteData() var api_endpoint = '/api/collections/search?fulltext_search=' diff --git a/src/store.js b/src/store.js index 434de07..02903f5 100644 --- a/src/store.js +++ b/src/store.js @@ -81,6 +81,10 @@ const store = new Vuex.Store({ if (found != -1) { weight = weight +1 } + var found = state.sites[site].title.toLowerCase().search(state.search_text.toLowerCase()) + if (found != -1) { + weight = weight +1 + } if (weight > 0) { var id = state.sites[site].id result[id] = weight