Searching with grouped words and operators

search
#1

If I need to allow searching in Kirby 3 with quotes to group words and be able to use “and” or “or” or “not” as boolean search words, would you recommend referencing the Kirby 2 search plugin and using Algolia?

And would it take a lot of work to make that plugin work for Kirby 3?

0 Likes

#2

I dont think it will be all that hard, looking at it. I think the dashboard widget will be headache, since that will need to done with Vue,js I think.

Alternatively, I’ve been kicking around making a plugin to add search using Lunr but all the guides I can find seem to depend on jQuery for the Ajax side of things. I would rather use Vanilla JS which im not terribly strong at (but thats the point). It’s an option though, and allows for things like “might contain” and “must contain” and “must not contain”

0 Likes

#3

Algolia is used on the getkirby.com website, you can find a plugin in the repo (without widget, don’t know what that widget was used for).

0 Likes

#4

The widget seemed to be for cache flushing.

0 Likes

#5

Thank you @jimbobrjames :smile:

@texnixe would the implementation of that plugin be identifiable if I dig into the code there? Or maybe it would operate the same as the default Kirby search?

0 Likes

#6

Stuff that belongs to the Algolia search:

  • algolia folder in site/plugins
  • site/config/algolia.php => the config settings, called in the config.php file
  • the search controller
  • the search template
  • the search content folder
2 Likes