• Resolved Tom

    (@esilverstrike)


    Hi,

    If I search for a word that I know is not on the website currently WordPress search returns all results. This can be a little confusing to users as they may think the word has been found.

    Is there a way to return no results if no matches are found and all results if no search query is given?

    This also seems to happen if I use WP Gridbuilder Search Text Facet.

    Thanks

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

    (@msaari)

    That is not how Relevanssi works. Relevanssi should return zero results. If you try the same search with the Relevanssi admin search at Dashboard > Admin search, what do you get?

    So, the question is: what on your site makes the search behave like that? Do you have any custom code related to the search?

    Thread Starter Tom

    (@esilverstrike)

    Yup you where right. I had a code snippet setting something for WP GridBuilder and the id of the field was incorrect.

    Thanks

    Thread Starter Tom

    (@esilverstrike)

    Hmmm…. technically this is still not solved. Sometimes it works and sometimes it does not, that’s why I though it worked above… (more often not)

    This also could maybe be in part a WP GridBuilder issue.

    https://www.esilverstrike.com/?s=
    https://www.esilverstrike.com/learning-academy/

    For the WordPress Search Page and archive search I use WP Gridbuilder Facets. One for the Text Search Field and then one for the load more button. I wanted a consistent search experience across the website.

    The search works fine except when searching for something that does not exist.

    For example if I search for “test” it brings up a certain number of pages. When I search for “tester” it brings up all the pages (when it should be none).

    In the Admin search it works as expected.

    Both of these are template pages… I do have a similar setup on another dev website. I also have a FAQs page with this type of search setup which seems to work fine…



    • This reply was modified 10 months ago by Tom.
    Thread Starter Tom

    (@esilverstrike)

    All right I use Bricks to build the pages so it looks like I had to enable a toggle for my query to turn on “Is main query (archive, Search) for the grid.

    It was working before when this was enabled (as you are only suppose to turn it on if the query is not working). It was working before I installed Relevanssi?but only partly after installing it. Enabling it did the trick and everything is working fine now.

    Hopefully my journey with this issue helps someone else! ??

    Plugin Author Mikko Saari

    (@msaari)

    Yes, Relevanssi is active in the main query, and inactive in any other queries, unless you explicitly activate it by setting the relevanssi query variable to true.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘All Search Results are returned if no Search Results found for search term’ is closed to new replies.