I’d of been happy to but I just logged in to Algolia again to grab my API keys for some tests with the node client, and noticed that the _tmp on the index has done away, and now only the primary wp_searchable_posts index exists.
On a side note, we want to give certain post types priority in our ranking, and unfortunately it doesn’t happen to be the case that alphabetical ranking (either asc or desc) would be the sort order we want, so we have to look for alternatives to this approach.
We’re thinking of using the node client to basically:
* pull the records in the index
* add an attribute to each record (i.e. post_type_priority)
* establish a priority for each post type (i.e. ‘photos’ would be priority 1, ‘videos’ priority 2)
* add this attribute as an attributeToIndex, and to customRanking, sorting either asc or desc
It’s a lot of reading and writing, and we’d have to rerun the whole thing every time we publish a post, to get the additional meta data added to the new posts’ index record in algolia.
Seems to me a better option would be a type of sort like so
customRanking: [
{ ‘literal(post_type)’: [‘photos’, ‘videos’]}
]
or something similar – I think you get the idea. Basically, give me more than just asc and desc, so I can provide a defined sort order for a non-numerical field.
Would be super helpful, and save me a lot of code and your servers a lot of reading / writing.