• Resolved rzharding

    (@rzharding)


    Greetings Ajay

    I have a Better Search facility on the right panel on every page of my website. I can use the +, – characters to do boolean searches. Using quotes to search on a field does not work as expected.

    It searches for all the words not the phrase.

    For example, the following works as expected.
    +blood +pressure +dash
    blood pressure dash

    However, “blood pressure” does NOT search for the phrase but returns the results of pages that contain both “blood” and “pressure”.

    Richard

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

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

    (@ajay)

    @rzharding

    I was checking your site and I do see the results for “blood pressure” first – the highlighting does work differently.

    Are you noticing posts e.g. in the search below which is missing results that have the phrase?

    wisenutritioncoaching.com.au/?s=%22blood+pressure%22

    I’ve been relooking at the code and I think a small code change could fix this – changing htmlspecialchars_decode to wp_specialchars_decode

    https://github.com/WebberZone/better-search/blob/v3.3.1/includes/class-better-search.php#L429

    • This reply was modified 4 weeks ago by Ajay.
    • This reply was modified 4 weeks ago by Ajay.
    Thread Starter rzharding

    (@rzharding)

    Greetings Ajay

    The second post in the blog list “What is a Heart Attack” has “blood” highlighted a number of times without the second word “pressure”.

    Is it possible to include in the Search Results, the count of the number of blog posts that include search token?

    I do not know what to do with the code tht you showed in the file:
    https://github.com/WebberZone/better-search/blob/v3.3.1/includes/class-better-search.php#L429

    Richard

    Plugin Author Ajay

    (@ajay)

    If it’s the highlighting, then that is normal as the highlighting works on words and not phrases so you’ll see both the blood and the pressure highlighted separately. With respect to the actually searching, that happens with phrases.

    Are you comfortable with editing files? If so, you can edit /includes/class-better-search.php and replace htmlspecialchars_decode with wp_specialchars_decode.

    If not, if you wait a few weeks, I’m pushing through a major release of the plugin alongwith a pro version that will have this changed.

    Thread Starter rzharding

    (@rzharding)

    Thank you Ajay.

    I will wait until your updated release and the PRO version.

    Better Search has been essential for letting visitors (including myself) find information on my website.

    Plugin Author Ajay

    (@ajay)

    Glad to hear that! To confirm I’ve fixed this in the Github repo.

    https://github.com/WebberZone/better-search/commit/426ddd664129fe6cab29b2af8e0e0ffba5ed1486

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.