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

SimpleSearch filters documentation

Started by Muut Archive 11 years ago · 1 replies · 444 views
11 years ago

From looking around I got the idea that filters defined in simplesearch.yaml is a list of taxonomies to limit the pages that will be searched, and filter_combinator denotes which logical operator (and, or etc.) should be applied to those.

However I could not find documentation that actually describes these points? The plugin README.md points at the Taxonomy and Headers doc pages, but there doesn't seem to be anything mentioned about filters or filter_combinator there to know the possible options.

E.g.

  • Can filter_combinator take 'not' as a value, so it will cause all pages with the listed taxonomies to be excluded from the results?
  • Is there a way to specify more complex filter conditions: something like taxonomy category = (x AND y AND z) OR a OR b OR c?
11 years ago

Currently SimpleSearch is very, well, simple. It has the ability to take a variety of taxonomies in the findTaxonomy() format. So something like:

YAML
category: [blog, news]
tags: [cats, dogs, sheep, fish]

It can take a combinator, so that's either and or or

If you set this to and, your page would have to satisfy ALL the category and tag requirements, so a page that has category blog and news, and tag cats and dogs and sheep and fish. Not very likely...

the or combinator, basically means the page would just have to have any one of those categories or tags.

Your more complex example is not possible at the moment. This is something I would like to add to the core Taxonomy object at some point, but requires a more involved parser.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1332 9 years ago
Archive · by Muut Archive, 9 years ago
2 923 9 years ago
Archive · by Muut Archive, 9 years ago
2 4053 9 years ago
Archive · by Muut Archive, 9 years ago
1 2931 9 years ago
Archive · by Muut Archive, 9 years ago
3 1109 9 years ago