• Resolved keepsmilyn

    (@keepsmilyn)


    We have noticed a massive spike in the size of the aws_cache table in our database in the last few days. Has there been any recent changes to your plugin that may be causing this? We updated to the version 2.01 of Advanced Woo Search Pro.

    At present this file (below) is at 20GB in size on our web server.
    /var/lib/mysql/wp_DBNAME/TABLENAME_aws_index.ibd

    Is there any to reduce this size asap as its taking up so much space on our server.

    Thank you kindly.

    • This topic was modified 4 years, 6 months ago by keepsmilyn.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author ILLID

    (@mihail-barinov)

    Hi,

    There is several solutions to how to decrease index table size.
    First of all – you can remove from index page all search sources that you don’t use for search.
    Please use following code snippet for this

    add_filter('aws_indexed_data', 'my_aws_indexed_data');
    function my_aws_indexed_data( $data ) {
        foreach ( $data['terms'] as $source => $all_terms ) {
            if ( strpos( $source, 'meta_' ) === 0 || strpos( $source, 'tax_' ) === 0 || strpos( $source, 'attr_' ) === 0  ) {
                unset( $data['terms'][$source] );
            }
        }
        return $data;
    }

    This code remove custom fields, taxonomies and attributes of products from the index table. If you need to sources to remove or want to leave some of them – please write me.

    Second – Do you need to display product variations inside search results? If no than make sure that plugin option ‘Variable products’ set to? ‘Show only parent products’.?
    Also please add following code snippet like and in previous example.

    add_filter('aws_indexed_data', 'my_aws_indexed_data2');
    function my_aws_indexed_data2( $data ) {
        if ( $data['type'] === 'child' ) {
            return false;
        }
        return $data;
    }

    You need to add this snippets somewhere outside plugins folder. For example, inside functions.php file of your theme or use some plugin for adding code snippets.
    Also, after adding them, you need to re-index plugin table.

    Regards

    Thread Starter keepsmilyn

    (@keepsmilyn)

    Thank you. I will check settings and apply these functions.

    Highly appreciate your detailed reply. Thank you. ??

    Thread Starter keepsmilyn

    (@keepsmilyn)

    We have enabled a handful of “Search in” options, which are searching within product attributes, so the second function can’t be used.

    Is there a way to auto clear cache? You have an option to setup a cron job to reindex table, can the same be done with clearing of cache? This way we dont need to manually clear the cache and it can be automatically done periodically?

    Thank you!

    Plugin Author ILLID

    (@mihail-barinov)

    Yes, you can clear plugin cache by calling

    do_action('aws_cache_clear');

    So you can create cron job to call this action during needed intervals.

    Regards

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Table size issue’ is closed to new replies.