Searching with grouped words and operators

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?

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”

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).

The widget seemed to be for cache flushing.

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?

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
4 Likes

As prompted in another thread I started on this topic, I’ve been trying to implement this Algolia plugin in Kirby 3. Rebuilding my search index works as expected when I use algolia()->index() in a template.

However, the search index is not updated when I modify an existing page or create a new page in the panel. The only way it appears to be working is when I call algolia()->index(). Am I missing something really basic like a hook somewhere? Any help would be appreciated!

@nigel Any luck with Algolia and Kirby?