• I just upgraded Better Search from 2.0.1 to 2.1.0. Under 2.0.1 searches using the + or – operators worked properly. Under 2.1.0 the same searches behave as if the boolean operators were not there. In fact, in the window that displays the search argument entered, the operators have been stripped off. Can you help?
    Barry

    https://www.ads-software.com/plugins/better-search/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author WebberZone

    (@webberzone)

    Barry, you can try turning on Boolean mode in the settings page. Does that give better results?

    I’ve spent a bit of time looking at how mySQL’s search works and from all my checking I haven’t been able to get the boolean operators to work in natural language mode

    Thread Starter barryclasper

    (@barryclasper)

    Boolean is turned on. It works on 2.0.1 but not on 2.1.0.

    Plugin Author Ajay

    (@ajay)

    Could you please tell me what search terms your exactly using, what you’re seeing and expecting to see? Also, site URL?

    Thread Starter barryclasper

    (@barryclasper)

    Following are the search tests I’m doing. The search arguments are this way, and the expected result follows.
    srchterm will show all (4) articles with test search terms
    srchterm1 (or +srchterm1) will show 3 articles containing that search term
    srchterm1 srchterm2 will show 4 articles having one or the other or both
    -srchterm1 srchterm2 will show 1 article having srchterm2 and not srchterm1
    -srchterm1 -srchterm3 will show no results (Even though logic says it should be lots – everything not containing those items. But I can live with it.)
    srchterm1 -srchterm2 -srchterm3 will show 1 result

    After cloning the production site, I ran those tests before upgrading to 2.1.0. They worked as expected. I upgraded to 2.1.0 and the results changed. Nothing else was updated between the before and after tests. Under 2.1.0 it appears the boolean operators are being stripped off the search argument before the search is done. Multiple terms all become a logical OR regardless of the operators entered.

    The production site is at https://callerlabknowledge.org and it is still running 2.0.1. The clone site is at https://f53.fce.myftpupload.com/ and is now running 2.1.0

    Here are the options specified in the Settings for Better Search:
    Enable seamless integration? Unchecked
    Enable search tracking? Checked
    Track visits of admins? Checked
    Track visits of editors? Checked
    Enable cache: Checked
    Stop search engines from indexing search results pages Checked
    Link to plugin homepage Unchecked
    Number of Search Results per page 10
    Post types to include in results post, page, attachment
    Enable mySQL FULLTEXT searching Checked
    Activate BOOLEAN mode of FULLTEXT search Checked
    Weight of title 1
    Weight of the content 10
    Highlight search terms Checked
    Include thumbnails in search results Unchecked
    Length of excerpt (in words) 200
    Filter these words (none entered)
    Include heatmap on the search results Unchecked
    Custom CSS (out of the box)

    Thread Starter barryclasper

    (@barryclasper)

    I just spent a half hour entering the data you wanted and this forum just threw it away. What gives?!

    Thread Starter barryclasper

    (@barryclasper)

    I just spent another 15 minutes rebuilding the post and it threw it away again. This forum is not working. Please send me an email I can reach you at and I will send the information there. [email protected]

    Plugin Author Ajay

    (@ajay)

    Barry, you can contact me at https://webberzone.com/contact/

    I’ve also had a couple of checks at my end and noticed that the new version strips out the + signs as part of the sanitisation process.

    This line needs to be commented out.

    https://github.com/WebberZone/better-search/blob/master/includes/utilities.php#L24

    Removing that line doesn’t open up a SQLi vulnerability, does it?

    Plugin Author Ajay

    (@ajay)

    No it shouldn’t. Further down, I run wp_kses_post which strips out anything that is not allowed in your normal post content editor.

    In the line you might only want to knock off the urldecode part of the code.

    Thanks @ajay. Will the fix be updated through the WP plugins site?

    Plugin Author Ajay

    (@ajay)

    Yes. I need to release a new version of the plugin that should have this fix. Most likely going to be a minor release at this stage.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Better Search 2.1.0 Boolean Operators Stopped Working’ is closed to new replies.