Search collection entries based on tags

I have a collection called items. The entries in this collection have tags that are set up as taxonomies.

Let's say there are three items that have the following tags:

*First item*
Title: "the title of the first item"
Tags: my-tag, your-tag, another

*Second item*
Title: "The title of the second item"
Tags: my-tag, your-tag

*Third item*
Title: "The title of the third item"
Tags: another


I've also set up a search page and search form. I want to be able to return collection entries when I search for the title and / or tags.

Examples: - Searching for "The title" should return all three entries; - Searching for "second item" should return the second item; - Searching for "another" should return items 1 and 3; - Searching for "my tag" should return items 1 and 2.

The tags don't have routes, they're there just for search purposes.

I have re-indexed search.

My collection yaml-file contains:

searchable:
  - title
  - tags

Problem

When I search for "my tag", it returns the tag itself as a search result, rather than the two collection entries I was expecting.

I'm overlooking something, I just don't know what. Hope you can help me out :-)

>>>>>>> Unanswered <<<<<<<
0 Replies
2 Followers