Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Hi, thank you for the patience.

    Not sure there’s necessarily anything we can do specifically in this case from the plugin’s code point of view. However, we do have filters that can be used to alter the attributes being indexed. So my question would primarily be which attributes and the like are you actively using with your search experience, and which are just happening to also be included.

    As a more specific example, are you actively using all of the taxonomies that are getting indexed? or could we filter some out from consideration and then re-index?

    Thread Starter Raza Khadim

    (@razakhadim)

    Thanks for getting back to me Michael. Seems like I could get rid of half of the data pushed to Algolia with each post. So the plugin indexes the ‘taxonomies’ which is what I need, in the Algolia dashboard I see there is another attribute ‘taxonomies_hierarchical’ which doubles up the size and the same taxonomies show up.

    https://postimg.cc/nC1svgTT

    and

    https://postimg.cc/crWgt07r

    would I be able to get rid of ‘taxonomies_hierarchical’? If yes, could you please provide some help on how to do it?

    Thanks

    • This reply was modified 1 year, 4 months ago by Raza Khadim.
    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Yes.

    Out of box, we have that set up for potential usage in the Instantsearch template, and the available “hierarchical widget” that Algolia provides. For example:

    /* Categories refinement widget */		instantsearch.widgets.hierarchicalMenu({
    	container: '#facet-categories',
    	separator: ' > ',
    	sortBy: ['count'],
    	attributes: ['taxonomies_hierarchical.category.lvl0', 'taxonomies_hierarchical.category.lvl1', 'taxonomies_hierarchical.category.lvl2'],
    }),

    If you’re not needing any for this widget type, then let’s get them removed.

    For example:

    function pluginize_algolia_remove_hierarchical_taxonomies( $shared_attributes, $post ) {
    
    	unset( $shared_attributes['taxonomies_hierarchical'] );
    
    	return $shared_attributes;
    }
    add_filter( 'algolia_post_shared_attributes', 'pluginize_algolia_remove_hierarchical_taxonomies', 10, 2 );
    add_filter( 'algolia_searchable_post_shared_attributes', 'pluginize_algolia_remove_hierarchical_taxonomies', 10, 2 );

    This would go in your active theme’s functions.php or perhaps a quick custom plugin if you prefer.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Record size chucking’ is closed to new replies.