Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Simplesearch: What does it search, and what can be customized?

Started by Muut Archive 11 years ago · 7 replies · 1105 views
11 years ago

This plugin is really driving me nuts (if I'm being honest), I can't seem to noodle out what it is actually looking for, and how to customize the search to cover multiple categories. I've looked at the RTFM skeleton and the Deliver skeleton files, and all I manage to do is break it.

I would like to be able to:

  • customize the results output
  • have it search (up to 4) multiple categories
  • plus I would love to see a yaml file with a comprehensive list of what can be customized

I have the latest version, and without touching it, using 1 category, it returns results, but that doesn't help me much.

Thanks in advance.

11 years ago

Make sure the plugin config contains e.g.

YAML

filters:
  category: ['blog', 'test']
filter_combinator: or

That should work

11 years ago

SimpleSearch was intended as a simple search solution (hence the name!), and it started off with just the ability to search title and content for strings based on a taxonomy filter.

It was recently updated to add support for searching text in the taxonomies for the page.

That is all it supports. It is not pluggable and was not intended to be so. There is definitely room for a more sophisticated search solution that uses indexes, but this has yet to be written!

11 years ago

BTW, if you needed to add something you could simply fork it, and modify it for your needs.

11 years ago

Yeah, I can totally understand that. Sorry if I came off a bit short. Actually, I am going to fork it, and see if I can get it to do what I want, it's a great start though.

When you say content, does that include information from just the page.md file, or will it also look at what is in a modular page and it's assets. I haven't really taken the time yet to get into the code to see what it's doing, I fully admit that - just haven't had the time yet.

Thanks.

11 years ago

It looks inside the modular pages "modules", but if combined with the taxonomy, I verified you need to put the taxonomy information inside the module pages too. Otherwise if the taxonomy is defined only on the "root" modular page, search does not work.
It's likely a shortcoming of the plugin, which can/should be fixed I think

11 years ago

Thanks for the follow-up. I'm not certain that it's a shortcoming, it probably adds a bit more flexibility to being able to include or exclude pages easily. It's certainly easy enough to add the taxonomy to the modular pages, though I can see where it would get unwieldy if you had a lot of pages.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1344 9 years ago
Archive · by Muut Archive, 9 years ago
2 930 9 years ago
Archive · by Muut Archive, 9 years ago
2 4058 9 years ago
Archive · by Muut Archive, 9 years ago
1 2943 9 years ago
Archive · by Muut Archive, 9 years ago
3 1116 9 years ago