Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #379357

    For “SearchWP” there is an option to limit the ajax search results:

    // limit the results to 5
    	function avia_searchwp_search_num_results() {
    		return 5;
    	}
    	add_filter( 'searchwp_posts_per_page', 'avia_searchwp_search_num_results' );

    Is there a similar setting for “Relevanssi”? For some search terms the list really gets too long on my page.

    #379748

    Hi StuWeTueHo!

    I found this which may help, http://www.relevanssi.com/knowledge-base/posts-per-page/.

    Cheers!
    Elliott

    #379934

    Thanks Elliott, but it only works for the standard search page. Maybe the provided code inside of my question was a little misleading. My question was targeting the AJAX search results.

    #380418

    Hi!

    Our AJAX search form limits the results to 5. Send us a link to your search page results so we can get a better idea of what your referring to.

    Best regards,
    Elliott

    #403836

    I would appreciate help with this issue too! Using Relevanssi and searching for a common term results in a too long Ajax search results list, it is impossible to scroll down to see the complete list or go to the view all results link. Try searching for barcode here: http://www.abol.ac.at/en/ to see the Ajax search result list.

    #404320

    Hi!

    Go to the Relevanssi panel then increase the Minimum word length to index: value to at least 4 then resave the index. You will get fewer and more relevant results when using the ajax search. Also, the theme’s ajax search returns a maximum of 5 items per post types, you can decrease that by adding this filter to the functions.php file:

    add_filter('avf_ajax_search_query', 'avf_modify_ajax_search_query', 10, 1);
    function avf_modify_ajax_search_query($search_parameters)
    {
    parse_str($search_parameters, $params);
    $params['numberposts'] = 3;
    $search_parameters = http_build_query($params);
    return $search_parameters;
    }

    Adjust the numberposts parameter.

    Cheers!
    Ismael

    #404731

    Thank you for your advice! Increasing the Minimum word length to index is no option, because DNA has to stay a search term.
    I also tried adding the filter you suggested, but unfortunately this didn’t change anything. A scrollbar of the ajax search results would be great like e.g. here: http://www.mindtheproduct.com

    #405022

    Hi!

    Add this to the Quick CSS field:

    .avia-search-tooltip form#searchform {
    overflow-y: auto;
    }

    If it doesn’t work, use this:

    .avia-search-tooltip form#searchform {
    overflow-y: scroll;
    }

    Cheers!
    Ismael

    #405032

    Thank you! The first code isn’t working, the second code displays a scrollbar, but this bar isn’t scrolling, please try yourself: http://www,.abol.ac.at search term barcode or DNA

    #406178

    Hey!

    Use this code instead:

    .ajax_search_response {
        max-height: 300px;
        overflow-y: scroll;
    }

    Best regards,
    Josue

    #406283

    Thank you very much! This code did the trick!

    #406300

    You are welcome, always glad to help :)

    Regards,
    Josue

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Limit ajax search results with Relevanssi’ is closed to new replies.