[Plugin: Relevanssi] Three Suggestions (score, orderby, comment author)
-
Hey Mikko,
First off, I just wanted to say this is a FANTASTIC plugin. After spending a few hours working it into my theme and playing around with it, I simply can’t believe how crippled the default search really is – and how I never realized it. So…thanks!
I’ve got just three comments I’d like to make:
1) It would be awesome if you could add the “relevance score” to the posts array returned by a search. Since you’re already returning these scores from relevanssi_search(), it should be a simple matter of adding the following on line 415:
$post->relevanssi_score = $return[5][$post->ID];By doing so, users can then display the scores next to each search result, if desired.
2) Although the plugin does search in comment content, it doesn’t seem to search commenter names. This is actually one of the features I was really hoping for, as there’ve been quite a few times when I wanted to recall “What was it that so-and-so told me about such-and-such?” So I’d search for that person’s name, hoping to find quick access to their various comments. (In the past, I get around WP’s limitations by just searching via Google :P)
3) Finally, it would be great to have the ability to set your own orderby. As it stands, whenever Relevanssi is active, search results are ALWAYS returned in order of relevance/score – regardless of the orderby query parameter. However, on my (custom) search page I provide links that allow the users to sort results by date, popularity, # of comments, etc. My initial thoughts were that I’d now be able to add a “Relevance” option (which I’d set as the default) – but since “orderby” is now ignored, I’m basically left with either using relevanssi or ditching the ability to let users sort their results altogether.
I did spend a good hour or so playing with this, but since I’m unfamiliar with your code I didn’t have much luck. You can see an example of how I have my search-sorting implemented here (Relevanassi is currently off):
https://www.justin-klein.com/?s=brazilThanks again!
- The topic ‘[Plugin: Relevanssi] Three Suggestions (score, orderby, comment author)’ is closed to new replies.