includes local title data in search

This commit is contained in:
buttle 2021-11-24 13:20:08 +01:00
parent 7e3481f0f1
commit 8292987e0a
2 changed files with 4 additions and 4 deletions

View File

@ -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='

View File

@ -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