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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Plugins

Indexing Taxonomies with TNTsearch

Started by Claud Rusnac 7 years ago · 3 replies · 1038 views
7 years ago

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?

7 years ago

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

👍 1
7 years ago

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?

👍 1
7 years ago

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?

Suggested topics

Topic Participants Replies Views Activity
Plugins · by Rene, 1 week ago
2 46 1 week ago
Plugins · by Xavier, 4 weeks ago
2 55 4 weeks ago
Plugins · by Luka Prinčič, 7 years ago
3 1181 1 month ago
Plugins · by Sebastian van de Meer, 1 month ago
1 49 1 month ago
Plugins · by PIERROT Alain, 2 months ago
3 73 2 months ago