Search page is very slow with more 400 products
-
Hi, the search is very slow when the products to look for are more than 400 or so. The ajax search on the other hand is very fast. At the moment I am forced to use a second plugin for the search page which is very fast and use yours only for the ajax search. I have already made all the changes that you have recommended to other users such as not including the variants, removing all the fields and taxonomies that I do not want from the index, limiting the results per page but in any case if the search exceeds 350/400 results it also takes dozens seconds to charge.
I would also like to use your plugin for the search page because I prefer it for functionality and it has compatibility with berocket ajax filter but at the moment it is impossible for me
These are all the functions enabled:function aws_page_results( $num ) {
return 350; // number added so as not to make the search very slow but in doing so it does not show all the results but always limits to 350
}add_filter(‘aws_posts_per_page’,’aws_posts_per_page’);
function aws_posts_per_page( $num ) {
return 48;
}add_filter(‘aws_indexed_data’, ‘my_aws_indexed_data2’);
function my_aws_indexed_data2( $data ) {
if ( $data[‘type’] === ‘child’ ) {
return false;
}
return $data;
}add_filter(‘aws_indexed_data’, ‘my_aws_indexed_data’);
function my_aws_indexed_data( $data ) {
$new_terms = array();
foreach ( $data[‘terms’] as $source => $all_terms ) {
if ( strpos( $source, ‘title’ ) === 0 || strpos( $source, ‘category’ ) === 0
|| strpos( $source, ‘attr_pa_fantasia’ ) === 0 || strpos( $source, ‘attr_pa_materiali’ ) === 0
|| strpos( $source, ‘attr_pa_taglia’ ) === 0 || strpos( $source, ‘attr_pa_altezza-vita’ ) === 0 || strpos( $source, ‘attr_pa_collezione’ ) === 0 || strpos( $source, ‘attr_pa_scollatura’ ) === 0
|| strpos( $source, ‘attr_pa_stile’ ) === 0 || strpos( $source, ‘attr_pa_stile-borsa’ ) === 0 || strpos( $source, ‘attr_pa_stile-capospalla’ ) === 0 || strpos( $source, ‘attr_pa_stile-gonna’ ) === 0
|| strpos( $source, ‘attr_pa_stile-pantaloni’ ) === 0 || strpos( $source, ‘attr_pa_stile-portafoglio’ ) === 0 || strpos( $source, ‘attr_pa_stile-tacco’ ) === 0 || strpos( $source, ‘attr_pa_stile-vestito’ ) === 0
|| strpos( $source, ‘attr_pa_stagione’ ) === 0 || strpos( $source, ‘attr_pa_stile-camicia-blusa’ ) === 0 || strpos( $source, ‘attr_pa_stile-coprispalle’ ) === 0
|| strpos( $source, ‘attr_pa_tipo-chiusura’ ) === 0 || strpos( $source, ‘attr_pa_tipo-costume-da-bagno’ ) === 0 ) {
$new_terms[$source] = $all_terms;
}
}
$data[‘terms’] = $new_terms;
return $data;
}`
- The topic ‘Search page is very slow with more 400 products’ is closed to new replies.