I’m hosting a static website on github pages (without jekyll) and I’d like to implement a search feature on client side
I have keywords each pointing towards a link as such:
search_map={
["keyword1", "keyword4"] : "link1",
["keyword1", "keyword2", "keyword3"] : "link2",
["keyword5", "keyword3"] : "link3"
...
}
search_query = ["keyword1", "keyword6"]
results = ["link1", "link3"]
My current approach has been to flatten out all keys and duplicate links instead and send a single object to client side to search:
{
"keyword1" : ["link1", "link2"],
"keyword2" : ["link2"],
"keyword3" : ["link2", "link3"],
"keyword4" : ["link1"],
"keyword5" : ["link3"],
...
}
is there any better and faster way to do this?