Open nikola3244 opened 6 years ago
Related to #183
Just had a bit of a revelation with this one. I realised what post_content
is being used for.
It looks like WP search doesn't search wp_postsmeta
by default. The workaround for this appears to be to embed that data into post_content
and then put the actual sermon text elsewhere (in this case in sermon_description
). I'm wondering if something can be done to remedy this in a better way.. 🤔
Yessssss, that's it! I completely forgot why I did it, until now. :laughing:
If you go back through commit history (and support forum threads) - I was saying exactly that - that we are making WP search work (it's also in changelog)
I guess my next question is where do we go from here? I'd say we have a few different options:
Do nothing. Keep things as they are. Actual post content goes into wp_postsmeta
as sermon_description
. I'd advise against this if at all possible not least because it would make #190 more difficult
Try and intercept WP search and bolt-on support for searching wp_postsmeta
. Not ideal, but I guess there are worse solutions
Drop first class support for search, put our content in post_content
and recommend that users install a third-party search plugin such as Relevanssi or some such. This would be my preferred solution because it would be the cleanest imho (though I appreciate you do have obligations to your users to support existing features).
I suspect the second option would be rather difficult to do well because of the fact that WP search does full table scans and has no indexing support.
Btw, "save into post_excerpt
instead of sermon_excerpt
" can be marked as complete on this issue
Thanks :wink:
Let me know if you are waiting on me on something, I may have missed it in the ton of emails
I'd be interested on hear your thoughts on the previous comment. https://github.com/WP-for-Church/Sermon-Manager/issues/184#issuecomment-386159419
Hahah, I knew that there was one, and it was right in front of me :laughing:
Okay:
Well, I'd prefer not to do option 1 if possible since it isn't really a solution. Though, if we do end up doing that I guess we can close this issue.
That leaves us with the second and third options. The third is probably the cleanest solution, though like I said I understand your position of not wanting to require users to use 3rd party plugins.
The second is a workaround, but I'll look into it and see how things are.
PS: We can probably get rid of the first checkbox in the OP as it's a duplicate.
Alright, if we do second one, we'll just need to add another bit to the SQL query, doesn't seem too hard.
Regarding third option, if you'd like that option because of (possible current) incompatibility with that plugin - let's just make it compatible :wink: (open an issue, if there's a bug)
PS: First and third checkboxes aren't duplicates. First one is about removing plain text rendering of the Sermon Manager's view, second one is about saving the content into the same place
My only concern is potential performance problems... We'll see I guess...
post_content
andpost_excerpt
~post_content
(instead ofsermon_description
)post_excerpt
(instead ofsermon_excerpt
)sermon_description
, for backwards compatibilitycc-ing @robertmain