algoliasearch-wordpress icon indicating copy to clipboard operation
algoliasearch-wordpress copied to clipboard

Searchable posts index replicas not appearing in dashboard

Open rob-wood-browser opened this issue 6 years ago • 0 comments

What did you expect to happen?

Custom replicas of the searachable_posts index to appear in the Algolia dashboard

What happened instead?

Replicas tab is still empty in the dashboard

How can we reproduce this behavior?

I've added the following to my functions.php file and pushed my settings via the plugin. Can't work out what i'm doing wrong!

add_filter( 'algolia_index_replicas', 'results_index_replicas', 10, 2);

function results_index_replicas( array $replicas, Algolia_Index $index ) {
    if ( 'searchable_posts' === $index->get_id() ) {
      $replicas[] = new Algolia_Index_Replica( 'post_date', 'asc' );
      $replicas[] = new Algolia_Index_Replica( 'post_date', 'desc' );
    }

    return $replicas;
}

Technical info

  • WordPress version: 4.7.2
  • Algolia Search plugin version: 2.10.2

rob-wood-browser avatar Apr 23 '18 13:04 rob-wood-browser