Today I installed Relevanssi to compare it with Better Search. Relevanssi is much more complex and has a lot of additional features. But Better Search is much smaller and let do MySQL the relevance calculation. Both solutions have advantages.
So in the moment, it’s not easy for my to show the used SQL query to you, since I uninstalled Better Search for the moment.
But like I suggested to use the WP_Query
class to you inside an other topic in this forum a few minutes before, I suggest to you: Do not investigate more time into your SQL generation at all. You waste a lot of time with this and you never can offer all the same features like WP_Query
can do. Additional Webmaster like me should know the WP_Query
implementation and its filtering with its pre_get_posts
action.
Because of this, I will not support you with your own SQL generation, even I have installed the Query Monitor and I know SQL good from previous jobs.
The disvantage of your own SQL gereration implementation forced me to analyse your PHP code to figure out, how I can implement my search restriction to some categories. After that, I had to find out, how WordPress implemented the category <-> post relationship and wrote more SQL code, than I could do this with the well documented WP_Query
class.
So with your own SQL generation, you not just wasted a lot of your time, you wasted also a lot of my time. Because of this, I let you know so detailed my knowledge about the WP_Query
class to not to waste further time.
I hope you understood my suggestions, and why I don’t support you with your question.
I still don’t know, what is better: Better Search or Relevanssi. Since Better Search let do MySQL the job of calculating and apply it with, I believe Better Search has advantages againt Relevanssi too.
But maybe I wrong… ??