marcu5p
Forum Replies Created
-
Forum: Plugins
In reply to: [WP Search with Algolia] Reindex post when a comment is addedHi Michael
Wow, lightning fast reply, thank you.
That works a treat, and of course makes perfect sense to modify the ci_comment_rating_save_comment_rating() instead.
Both elements now working, only thing left to say is… you’re a star!
Thanks as always
MarcusForum: Plugins
In reply to: [WP Search with Algolia] Reindex post when a comment is addedHi Michael
Thanks for your swift reply as always.
You’re right I am wanting to index the comment count, and your function works a dream so thanks for that.I have also implemented a simple star star rating for comments (a version of this https://www.cssigniter.com/add-rating-wordpress-comment-system/) and called the ci_comment_rating_get_average_ratings function in an attempt to also index the average rating at the same time. It nearly works but indexes the ratings previous value which I guess is down to not reaching reaching the catch block.
Any ideas on solving this bit would be much appreciated.Thanks
MarcusForum: Plugins
In reply to: [WP Search with Algolia] Facet Display filterYes, got it working, thanks so much.
Forum: Plugins
In reply to: [WP Search with Algolia] Facet Display filterYes for sure I’d need to use the Push Settings button to trigger it.
But I can’t get the function constructed correctly, that’s really where I need your knowledge.
using:
function facet_display_index_settings( array $settings ) { $settings['renderingContent'] = ['solution_name' => ['Stress Testing', 'API Access'], ]; return $settings; } add_filter( 'algolia_searchable_posts_index_settings', 'facet_display_index_settings' ); add_filter( 'algolia_posts_index_settings', 'facet_display_index_settings' );
And then “Push Settings” gives me this error:
An error occurred: Error in renderingContent parsing: Unexpected value type: invalid key 'solution_name'. Expected: facetOrdering, redirect (near 1:51)
Thanks.
Forum: Plugins
In reply to: [WP Search with Algolia] Facet Display filterHi Michael
Thanks for the reply. I want to push settings to Alogia Facet Display configuration.
So, I have a list of Products (attribute is solution_name) which form one of my facets. I can sort these easily asc or desc by name or count (with js), but I need them in a custom order. I can achieve this via the Alogia dashboard using Configuration -> Facet Display (renderingContent) and pin the items it the order required. Once they are in the correct order they won’t change.
I need to push this order from WordPress rather than having to go to the dashboard, in a similar way we are pushing which attributes to use for faceting using attributesForFaceting.
For example I have tried this but it doesn’t work:
function custom_posts_index_settings( array $settings ) { $settings['renderingContent'] = ['solution_name => ['Solution One', Solution Five', 'Solution Three', 'Solution two', 'Solution Four'], ]; return $settings; } add_filter( 'algolia_searchable_posts_index_settings', 'custom_posts_index_settings' ); add_filter( 'algolia_posts_index_settings', 'custom_posts_index_settings' );
Thanks as always
Forum: Plugins
In reply to: [WP Search with Algolia] Configure attributes for faceting issueThis works:
function custom_posts_index_settings( array $settings ) { $settings['attributesForFaceting'] = ['resource_type', 'solution_category', 'wpml.display_name', 'post_type']; return $settings; } add_filter( 'algolia_searchable_posts_index_settings', 'custom_posts_index_settings' ); add_filter( 'algolia_posts_index_settings', 'custom_posts_index_settings' );
Forum: Plugins
In reply to: [WP Search with Algolia] Configure attributes for faceting issueHi Michael
Thanks for your reply.
No I’m afraid that doesn’t work either.
Forum: Plugins
In reply to: [WP Search with Algolia] Create 2 indexesHi Michael
Thanks for you swift reply as always.
At the moment I have decided to use a single index and use a filter to return only the records (just my custom post types) I need for my separate search page. Seems to work ok, but I will investigate the information you given as ideally 2 indexes would be good.
Thanks again
Forum: Plugins
In reply to: [WP Search with Algolia] Format a custom taxomonyThank you.
Forum: Plugins
In reply to: [WP Search with Algolia] Format a custom taxomonyThanks for the steer really appreciate it. The below seems to do exactly what I wanted, but I need to do more testing to check.
function ss_algolia_resource_attributes( array $attributes, WP_Post $post ) { $taxonomy = 'global_tag'; //Taxonomy Name $terms = get_the_terms( $post->ID, $taxonomy ); $resource_type_children = ''; foreach ( $terms as $term ) : if( $term->parent == 62 ) { //Parent Term ID $resource_type_children .= $term->name; } endforeach; $attributes['resource_type'] = $resource_type_children; return $attributes; } add_filter( 'algolia_post_shared_attributes', 'ss_algolia_resource_attributes', 10, 2 ); add_filter( 'algolia_searchable_post_shared_attributes', 'ss_algolia_resource_attributes', 10, 2 );
Forum: Plugins
In reply to: [WP Search with Algolia] Format a custom taxomonyOk, thanks for the pointer, I’ll investigate further.
Forum: Plugins
In reply to: [WP Search with Algolia] Format a custom taxomonyHi Michael
Thanks for the quick response.
Yes, and then be able to create another object where it just shows children of Employees
so level 1 is just “Harry Bunce”.Thanks
MarcusForum: Plugins
In reply to: [Temporary Login Without Password] Expire after number of successful LoginsThanks for the reply, I look forward to seeing this functionality.