It seems huge posts are splitted and so appears many times in the index and it’s faking the number of results displayed
add_action(‘pre_get_posts’, function( $query ) {
if ( !is_admin() && $query->is_main_query() && $query->is_search() ) {
$query->set( ‘posts_per_page’, 24 );
}
}, 1);
When results have huge posts, number or returned results will be lower. 20 ,21 …
I also wonder if it can’t be a problem when results are paginated because of this behaviour.. ;will page 2 really be page ?
-
This reply was modified 1 month, 2 weeks ago by
winniezz.
-
This reply was modified 1 month, 2 weeks ago by
winniezz.
-
This reply was modified 1 month, 2 weeks ago by
winniezz.
ps: I’m using elementor to display query results using built-in loop-grid with current query.
Hey @winniezz –
Thanks for reporting this issue. We are checking the issue and will get back to you asap.
Best Regards,
Darko
Hey @winniezz – post splitting / de-duplication bug is now fixed in v1.2.2.
Thanks for reporting.
Thank you 😉
But I still have “random” number of results (14 ?) on standard elementor search page and some overlaps between pages
page 1 : a b c d e
page 2 : e f g h i (we already had e one page 1)
this kind of behaviour
-
This reply was modified 1 month, 1 week ago by
winniezz.
if I’m using
add_action(‘pre_get_posts’, function( $query ) {
if ( !is_admin() && $query->is_main_query() && $query->is_search() ) {
$query->set( ‘posts_per_page’, 10 );
}
}, 1);
I got 5 results on page 1
with
add_action(‘pre_get_posts’, function( $query ) {
if ( !is_admin() && $query->is_main_query() && $query->is_search() ) {
$query->set( ‘posts_per_page’, 20 );
}
}, 1);
I get 11 results on page 1
I suppose it depends if some posts are duplicated in the index or not.
Also, in indices panel it’s shown “82435 / 43982” in “Documents” column
will try this command and re-build index, will keep you in touch
define( 'CELERSEARCH_SPLIT_POSTS', false );
-
This reply was modified 1 month, 1 week ago by
winniezz.
-
This reply was modified 1 month, 1 week ago by
winniezz.
it works, indexing is much more slow now but it works.
(search is still fast)
Thanks for the valuable info @winniezz. I will address this in a new version. I want to make the post splitting work really well for performance reasons.