• Resolved Anonymous User

    (@anonymized-473288)


    Hi,

    First off thank you for this plugin, it works nice, and thank you for documenting the code for example. I searched for this but couldn’t find anything for this plugin i support or docs, with people looking to do similar.

    I’m looking to add a feature that I need for an use case. I want to be able to exclude certain word patterns from the matching before output, so that these words are not used. For example the words ‘makeup tutorial’ occurs a lot, and causes these to show as relevant, while there are more relevant posts if you exclude words like that.

    I know how to code do this in PHP, my question is how can I best override the filter for that for example so it plays nice with the plugin and upgrades? Or is it not possible to override filter and do I need to catch it some other way? Like adjusting database values.

    I hope this question doesn’t put you too much out of your way, I will look for solutions as well in the mean time, but before I am reinventing the wheel maybe or overlooking some preferred method.

    • This topic was modified 4 years, 3 months ago by Anonymous User.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Ajay

    (@ajay)

    I haven’t done this yet, but am thinking one option would be to filter crp_posts_where to update the where clause with a condition that is along the lines of post_title and post_content NOT LIKE %term%.

    I haven’t tested it but thinking this might be a solution as fulltext support doesn’t let this to happen in natural language mode which is what the plugin uses.

    Please note that this filter gets deprecated in v3.0.0 as that will support WP_Query style arguments and filters.

    Plugin Author Ajay

    (@ajay)

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Exlude words from matching pattern before output’ is closed to new replies.