Heh, Relevanssi does indeed index tags, but doesn’t offer any good way to filter the search for them. The “tag” input field should work, but doesn’t. I probably should add it.
However, filtering by custom fields work. In free version, you can only filter by existence of a custom field (so you could see if the post has a custom field “video”) “&customfield_key=video”, but in Premium you can also filter by value, so you could have “&customfield_key=type&customfield_value=video”.
Thread Starter
Sean
(@seanm5)
Thank you for the quick response. “&customfield_key=video” doesn’t seem to be working for me however, it still shows the default results (all results sorted by relevancy) rather than just the posts with “video” custom field.
This is the full code I have:
<li><a>?s=<?php echo get_search_query();?>&customfield_key=video">Video</a></li>
Are you sure that is in the free version? I’ve just purchased the premium one anyway so hopefully it’ll work in that.
Thread Starter
Sean
(@seanm5)
The customfield_key filter works on premium, so that’s excellent!
However is there a way I can make it look for TWO custom fields (both “video” AND “youtubevidid”)? I’m not good with PHP or anything so I don’t know how to construct the URL for that.
Ah, you’re correct – it doesn’t work with the free version.
Unfortunately right now it’s not possible to filter by two custom fields. I can make it possible in a later version, but it takes some extra code (I’ve done it for taxonomy terms, so it’s possible).
Thread Starter
Sean
(@seanm5)
Thank you, that would be much appreciated if you can add this capability to a future version! 🙂
I have hundreds of video posts, half which use the “video” custom field and the other half use “youtubevidid” custom field. If I were to filter by just one of those custom fields, a huge amount of results would be missing.
Being able to filter by two custom fields would not only fix that problem, but it would also allow me to offer other helpful options on the search page (such as a “videos with transcripts” filter).
I’ve got couple of things on my to-do list, so it’s probably not going to happen in the next version, but it’s on my list of things to do and since it’s a question of recycling old code, it’s still going to happer sooner rather than later.
This is something that I have been trying to do also.
I am in the process of setting up a Repository/Referatory for freely available Medical Education Resources. Each WP Post contains content about a medical resource, and a link to the resource. Each post can belong to one or more category, and can be tagged to represent target audience, difficulty, resource type, etc.
The Relevanssi plugin has made searching and filtering by category amazingly powerful. Thank You.
However the number of resources is going to continue to grow in the coming months and years, and would love to be able to further filter by tags.
For example: Search for “searchterm”, in Category “Diabetes”, and tagged as “Lecture, Senior Doctor”
somesite.com/?s=searchterm&cat=8&tags=lecture,snr-dr
Using the “&Cats” term in the search I can search in multiple Categories (although seems to be working as an OR filter rather than AND), this functionality for tags would make my day!!
Loving the plugin. Thanks
(currently using the free version, as a department we may soon look to the Premium version)
This is one of the features in the upcoming Relevanssi Premium 1.6 and probably eventually in the free version.
“cats” is an OR filter, because I think it’s more useful for more people that way.