• Resolved ericmulder

    (@ericmulder)


    Hi,

    When using algolia as the backend search engine, I encountered the following bug. Although algolia gives the right (fuzzy) results back, they don’t show up. For example, if I search for ‘seearching a match’, algolia return the post_id (say id = 1) of ‘searching a match’, but then the WP_Query still executes something like SELECT bla WHERE post_title LIKE '%seearching a match%' and post_id IN (1) which return zero records.

    This is because the s parameter still gets added to the final WP_Query.

    A quick fix is to reset the ‘s’ parameter, but this breaks other functions like get_search_query()

    I reset the s parameter here:

    
    function labelvier_algolia_should_filter_query($should_filter, $query) {
    	if($should_filter) {
    		$query->set('s', null);
    	}
    	return $should_filter;
    }
    add_filter('algolia_should_filter_query', 'labelvier_algolia_should_filter_query', 10, 2);
    
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Thread Starter ericmulder

    (@ericmulder)

    They are different issues, as one is a typo search shows no results, and the other is that paging doesn’t work with backend search.

    I’ll submit 2 github issues and maybe a pull request ??

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Sounds good, thanks Eric.

    Plugin Contributor Richard Aber

    (@richaber)

    As @ericmulder reported on Github, this appears to be due to an incompatibility or conflict with FacetWP.

    https://github.com/WebDevStudios/wp-search-with-algolia/issues/97#issuecomment-707057012

    I don’t think this is due to FacetWP. I am not using it but when I enable “Use Algolia in the backend”:

    – The autocomplete responds to config changes within Algolia.
    – However, very poor results are returned in WordPress that do not align with what I am seeing in the Algolia admin (for the same queries).
    – Examples, are searching for “soup” I get everything except soup (soap, superior, etc.) and searching for “noodles” returns zero results when there is plenty of soup and noodles on my site.
    – I then went into the Typo Tolerance section of the Algolia admin and tried to change it to min and then strict but none of these configs changed the results at all (however, these configs did impact the autocomplete).
    – I then just turned of Typo Tolerance and I get the exact same results as I did when it was enabled.
    – Note that I have not installed any plugins that would impact the search

    • This reply was modified 4 years, 1 month ago by deandid. Reason: fix typos
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Typo searches bug when using Algolia as the backend search’ is closed to new replies.