-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create rule for combining multiple consequences #228
Comments
I believe the wiki page at https://github.com/WebDevStudios/wp-search-with-algolia/wiki/Index-Settings would be the examples needed here, towards the bottom. Those examples would be the hooks wanted to set custom settings for, when indexing, so that they get sent when clicking to push up settings. List of all the hooks available are at https://github.com/WebDevStudios/wp-search-with-algolia/wiki/Filter-Hooks and https://github.com/WebDevStudios/wp-search-with-algolia/wiki/Action-Hooks |
Algolia settings use the $index->setSettings method, but rules use $index->saveRule, so I don't think your settings hooks would work. |
Pushing settings does not delete Rules added via the Algolia dashboard. So I can do it that way for now. Would be great if I could set this via the API and wp-search-with-algolia. |
The hooks should work fine, more a question of what code/endpoints etc would be getting used in the callbacks, but I'm not going to claim that definitely at the exact moment either. I do think I need to test things out yet |
Upon some digging in and further review, I am agreeing that the hooks are in the wrong place in terms of custom rules. The rules are a separate section outside of index configuration. |
Haven't quite found out if/where the saveRule method is available to us, outside of maybe just instantiating things ourselves custom. The idea being that it's maybe possible to start an object instance within a callback running on settings pushing, to push the rule as well. |
Thanks for looking more into it! I think at this point it's just easier to use the Algolia dashboard, though I'd much prefer using the API. Consider this a feature request for a specific hook for adding Rules. |
Since we bundle in libraries still maintained from Algolia, I have to believe we have the tools available as a whole, but the plugin may not have been specifically set up to handle. Perhaps room for new features in the future. That said, yes for now best to use the Dashboard. |
I would like to add a rule in Algolia for combining multiple consequences, as described in their documentation here: https://www.algolia.com/doc/guides/managing-results/rules/merchandising-and-promoting/how-to/combining-multiple-consequences/#using-the-api
Is it possible to do this using their PHP API via WP Search With Algolia? I don't see anything in your documentation about adding rules, and though there are some rules-related methods in Searchindex.php, I don't see any obvios hooks where I could add one.
Is it your recommendation to just use the Algolia Dashboard to create rules (assuming they won't be over-written when pushing settings)?
The text was updated successfully, but these errors were encountered: