• Hi, the reason of this post is because we are performing some queries using the faceted plugin and the amount of results we are getting somtimes is bigger than 2000 posts, but all of them are shown at once in the same page, so the site is being collapsed.Any idea if there is any possibility to call or try some paging???.
    Looking the query.php of the wp-admin and the search of the theme has been tryed, and both are using the function query_post() giving as first parameter one array with a category selected or just some combination of categories using and OR or, but not a combination, e.g.,
    SELECT *FROM * WHERE category1==”1″ AND (cat=”2″ OR (cat3=”3″ AND cat4=”4″) )
    Meanwhile any solution comes through, the sql LIMIT is being used but even having the same prob. All the results in the same page.
    Thanx in advanced

    http://wordpress.org/extend/plugins/faceted-search/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter doiches

    (@doiches)

    Hi everyone in the forum, i keep on trying to page the search with the plugin using as i wrote the categories. I have tryed to re-adapt the facetedsearch_smart_query function but i am getting lost cuz no results are diplayed or not paged even when the array contains the $pageposts. Not even a clue with the pagination.
    Could any one give me a clue?
    Thanks in advanced:

    Here is the function code modified:

    function facetedsearch_smart_query($effective_array, $descendant_array)
    {
    global $wpdb;

    $query = ‘SELECT DISTINCT * ‘;
    $queryfrom = ‘FROM ‘.$wpdb->posts;
    $querywhere = ” WHERE post_type = ‘post’ AND post_status = ‘publish’ “;

    $siblings = $_POST[‘taxonomy’];
    $indexes = array();

    foreach ($siblings as $clave => $valor)
    {
    if ($valor == 0)
    {
    array_push($indexes, $clave);
    }
    }

    foreach ($indexes as $clave => $valor)
    {
    //generar los arrays dinamicamente
    ${$indexes.$valor} = array();
    }

    foreach ($effective_array as $clave => $valorefectivo)
    {
    $cat_name = get_category_parents($valorefectivo,false,’ » ‘);
    $category->name = substr($cat_name ,0, strpos($cat_name,’ » ‘) );
    $id= get_term_by(“name”,$category->name, “category”);
    $id = $id->term_id;
    array_push(${$indexes.$id}, $valorefectivo);
    }

    foreach ($indexes as $clave => $valor)
    {
    if ( count(${$indexes.$valor}) > 0 ){
    $querywhere .= ‘AND (‘;
    $querywhere .= facetedsearch_simple_query(${$indexes.$valor},null,”OR”);
    $querywhere .= ‘)’;
    }
    }
    $querywhere .= ‘ ORDER BY post_date DESC’;
    $query = $query.$queryfrom.$querywhere;

    $totalevents = $wpdb->get_results( $query, OBJECT );

    $ppp = intval( get_query_var( ‘posts_per_page’ ) );
    $wp_query->found_posts = count( $totalevents );
    $wp_query->max_num_pages = ceil( $wp_query->found_posts/$ppp );
    $on_page = intval( get_query_var( ‘paged’ ) );

    if( $on_page == 0 ) { $on_page = 1; }

    $offset = ( $on_page-1 ) * $ppp;

    $wp_query->request = $query.” LIMIT “.$ppp. ” OFFSET “. $offset;
    $pageposts = $wpdb->get_results($wp_query->request, OBJECT);

    Plugin Author AndrewUlrich

    (@andrewulrich)

    Hi doiches, just so you know, I might have some time tomorrow or this weekend to look into this.

    Plugin Author AndrewUlrich

    (@andrewulrich)

    Please update to version 3.4 for paged results.

    Paging is not working, I’m running WP 3.4.1 with Faceted Search 3.4.4 and the GET method.

    For testing purposes WP is set to:
    Blog pages show at most 1 posts

    http://proyectos.nrmalstudio.net/ks/

    What would you recommend guys?
    Thanks in advance!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Faceted Search] Facing Paging problem’ is closed to new replies.