I would like to index my taxonomies using tntsearch so that when searching, the results will show up appropriately. Any Idea how to accomplish this?
Community guidelines
Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.
Hi @crusnac, I just added this ability to my Learn2 with Git Sync theme so you are more than welcome to use that as a working example!
Add function to getSubscribedEvents():
https://github.com/hibbitts-design/grav-theme-learn2-git-sync/blob/master/learn2-git-sync.php#L19
Function to include Taxonomy item 'tag' in search index:
https://github.com/hibbitts-design/grav-theme-learn2-git-sync/blob/master/learn2-git-sync.php#L23-L31
I learned the basics of how to do this at:
https://github.com/trilbymedia/grav-plugin-tntsearch#customizing-the-search-index
Hope the above is of help, let me know how things go.
Paul
Thanks Paul - The solution worked. I ended up creating a simple plugin to perform the indexing.
My only issue: not sure if it's a TNTSearch issue, but most of my tags include a "-" in-between the phrases (i.e. tvm-01) and when I search for tvm-01, nothing matches. Only when I search for "tvm 01" I get any results.
Any Ideas?
Hi @crusnac, great to hear you got it going with a custom plugin!
Not sure, but my hunch is that since "-" is a minus sign that might be triggering some sort of Boolean operation with TNTSearch. However, I tried to disable that feature in the Plugin Options and the issue remains. Might be worth digging deeper or if possible explore another separator item and see if that works?
Log in to reply.
Suggested topics
| Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| 2 | 43 | 1 week ago | ||
| 2 | 53 | 4 weeks ago | ||
| 3 | 1179 | 1 month ago | ||
| 1 | 47 | 1 month ago | ||
| 3 | 72 | 2 months ago |