Forums Forums Search & Filter Pro Relevanssi integration not working

Tagged: 

Viewing 7 posts - 1 through 7 (of 7 total)
  • Anonymous
    #249258

    Hi Trevor,

    Searching for terms with relevanssi (search field in in page header) loads the results via search.php. Filtering with S&F forgets the search and loads a new page, resulting on a filter on all products instead of the search result. I followed this guide: https://searchandfilter.com/documentation/3rd-party/relevanssi/
    And tried all kinds of different settings. I use a custom post type.

    The search field in the filter bar is from S&F.
    Page: https://www.fietspitstop.nl/afdeling/fietsbanden/ . For example, try searching on “big apple”.

    Can you please help me in the right direction making the filter work on Relevanssi search results?
    Thanks,
    Roeland van Oostenbrugge

    Anonymous
    #249259

    To make the question more clear: how can I seperate the search field (by Relevanssi) and the filters to be shown on different locations, while both still taking each other into account.

    Trevor
    #249282

    We have received feature requests to allow the one form to be broken into parts to be placed (and styled) in different places (and differently styled) on the page.

    We have taken those requests on board for our forthcoming V3 (which we hope to release in summer 2020 – but that may flex a little as we polish the code and UI). For example, you might have a form in WooCommerce that has a Search Box (text field), a Sort Order drop down, and then other fields (Product Categories, Product Tags, Variations, etc). You will be able to place the Search Box in the header, and the Sort Order above the products, and the rest of the form in the sidebar.

    But, that is not possible right now.

    As to taking a theme search (like one might see in a header or main menu) and directing that to our search form, this is possible, as long as, on the results page, the Search & Filter form also has a text search. Also, on the search results page, the two forms will NOT ‘talk’ to each other (see my earlier comments about splitting the form up).

    You need to decide where you want to send the search (either a page with a slug or not), and use a WordPress rewrite in your child theme functions.php file.

    There is an example here (the site shown uses a slug name for the search results page, which looks nicer):

    https://support.searchandfilter.com/forums/topic/using-default-wp-search-bar-to-show-sf-results-page/#post-243811

    Here there is an example of one that doesn’t use a slug:

    https://support.searchandfilter.com/forums/topic/how-to-maintain-search-string-while-filtering/#post-205209

    Anonymous
    #249318

    Nice, this is doing the job perfectly, thanks!

    One subsequent question; what is the best way to get the search query string from S&F to use in the theme? I think it will sometimes be available in php but always via JS?

    Trevor
    #249328

    Do you want to be able to display the ‘searched for’ term? See here:

    https://support.searchandfilter.com/forums/topic/get_search_query-stops-working-with-relevannsi-enabled/#post-249201

    This other thread is about Relevanssi also.

    Anonymous
    #249336

    Working perfect now, thanks again!

    Trevor
    #249344

    Thanks for letting me know. I will close this thread for now.

Viewing 7 posts - 1 through 7 (of 7 total)