V20 – Pagination and Results partially loading.

  • ekimunal
    Participant
    # 6 days ago

    Hello,

    We have multiple sites running on the version 20 yet we can not currently update to current version.

    It seems like search function and results are not working properly. This was implemented by another developer and I am trying to take over and fix issues.

    What should I investigate? Where to start?

    Couldn’t load results with default sort, it works after sorting is changed.

    Wont Work:
    /?s=police
    /?s=police&wpsolr_sort=sort_by_date_desc
    /page/2/?s=police

    Does Work:
    /?s=police&wpsolr_sort=sort_by_relevancy_desc

    Once set to relevancy it starts working including paging, but with dates it is not working.

    What might be the issue?

    wpsolr
    Keymaster
    # 5 days, 23 hours ago

    What do you see in debug.log?

    It could be that the sort fields are not indexed. Try to select them in screen 2.2, then add them to the sort fields in 2.4. Also add the WPSOLR sort widget to your search page: that will show you how to generate the sort urls for your fields.

    ekimunal
    Participant
    # 5 days, 5 hours ago

    Here are the 2.2 and sorting screens. They seem normal to me but not sure.

    wpsolr
    Keymaster
    # 5 days, 5 hours ago

    You should check your debug.log.

    wpsolr
    Keymaster
    # 5 days, 5 hours ago

    And your logs?

    ekimunal
    Participant
    # 5 days, 5 hours ago

    I am not getting any logs related to wpsolr in my debug.log, is there a special log for wpsolr?

    ekimunal
    Participant
    # 5 days, 5 hours ago

    My bad, php error log has nothing but apache logs has lots of this:

    [Tue Sep 10 16:28:07 2019] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use ‘LimitInternalRecursion’ to increase the limit if necessary. Use ‘LogLevel debug’ to get a backtrace., referer: /page/5/?s=police&wpsolr_sort=sort_by_relevancy_desc
    [Tue Sep 10 16:28:07 2019] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use ‘LimitInternalRecursion’ to increase the limit if necessary. Use ‘LogLevel debug’ to get a backtrace., referer: /page/5/?s=police&wpsolr_sort=sort_by_relevancy_desc

    ekimunal
    Participant
    # 5 days, 5 hours ago

    Will check this limit now

    ekimunal
    Participant
    # 5 days, 5 hours ago

    Enabled debug but cant get any logs in apache log again, redirect issue seems resolved yet it is still not loading unless relevancy filter is selected.

    wpsolr
    Keymaster
    # 5 days, 4 hours ago
    ekimunal
    Participant
    # 5 days, 4 hours ago

    Yeah sorry, nothing related to Solr in the debug.log or apache logs.

    try {
    if ( ” === get_search_query() ) {
    throw new Exception( ‘No query specified.’ );
    }
    $localization_options = OptionLocalization::get_options();
    $final_result = WPSOLR_Service_Container::get_solr_client()->display_results( WPSOLR_Service_Container::get_query() );

    $sorts = WPSOLR_Data_Sort::get_data(
    WPSOLR_Service_Container::getOption()->get_sortby_items_as_array(),
    WPSOLR_Service_Container::getOption()->get_sortby_items_labels(),
    WPSOLR_Service_Container::get_query()->get_wpsolr_sort(),
    $localization_options
    );
    $query = WPSOLR_Service_Container::get_query();
    $query->get_posts();

    } catch ( Exception $e ) {
    $sorts = array();
    $facets = array();

    // On failure, we revert to an empty WP_Query which would have no results.
    $query = new WP_Query();
    }

    Here is the custom modifications we use with WPSOLR

    wpsolr
    Keymaster
    # 5 days, 4 hours ago

    I can only suggest to remove the custom code. All should be good again.

    ekimunal
    Participant
    # 5 days, 4 hours ago

    Removing custom code did not fix the issue, tried default with same results. Any idea what might be the issue?

    ekimunal
    Participant
    # 5 days, 4 hours ago

    If you select sorting from the filters as relevancy, everything is working as it should, I wonder why it does not work when I select by date

    wpsolr
    Keymaster
    # 5 days, 4 hours ago

    It could mean the date is not indexed, for any reason. Or that the date has the wrong schema type, not sortable.

    Or that your Solr index was not created at all from the plugin: without the right Solr schema, strange random things then happen.

Viewing 15 posts - 1 through 15 (of 33 total)

You must be logged in to reply to this topic.