I think it'd be pretty nice to be able to add an aggregation for authors to the search widget, assuming it's possible. :)
I'm going to remove my assignment for now since I have a few other things to address for the release.
👍 I'll take a stab at it if no one beats me to it.
Not currently possible as we don't have the remote user ID or username in the ES index apparently.
Abandoned (for now) branch is here: https://github.com/Automattic/jetpack/tree/update/search/widget-author-aggregation
It looks like there are also cases where we don't have the original author's name in the post when the author is not connected to wp.com. I'm not sure if this always happens or only happens when the site is using something like advanced custom fields to handle author info. Needs testing, but definitely related to the indexing problems on this issue so adding here for now.
Also suggested in 1036350-zen
I tested with the following steps to see if the original author's name gets attached to the post when the author is not connected to WordPress.com.
/sites/$site/posts/ and check to see if the original author's name is attached to the post.Result: the author's name is present if a post is published by an author not connected to WordPress.com.
{ ID: 11, site_ID: 146008467, author: { ID: 2, login: "testuser", email: false, name: "Test User", first_name: "Test" …} …}
I'm not sure if this always happens or only happens when the site is using something like advanced custom fields to handle author info.
To help further, would using the method in the following tutorial be a good way to test?
http://www.wpbeginner.com/wp-tutorials/how-to-rewrite-guest-author-name-with-custom-fields-in-wordpress/
I am removing the [Pri] High label from this issue because previous work from a few months ago was put on hold and because there hasn't been any development activity on this for over 5 weeks. Please add back the label if you still consider the issue high priority!
This is a pretty annoying issue for any site with multiple authors who haven't themselves connected jetpack to wordpress.com, and actually results in a search experience when searching for authors significantly worse than with Jetpack search disabled.
We have more than 50 authors and guest authors, many of whom will have no idea what I mean if I ask them to link their accounts to wordpress.com. Is there an alternative option in the meantime to allow them to appear in search results?
1235355-zen
For sites with a lot of authors is rather burdensome to have to ask all authors to create WordPress.com accounts. Hoping we can up the priority on this since I'm assuming this will impact Go sites as well.
@orenwolf the only current work around I can think of would be to create a custom taxonomy for those authors and then override which fields are searched against using https://developer.jetpack.com/hooks/jetpack_search_es_wp_query_args/ https://github.com/Automattic/jetpack/blob/master/modules/search/class.jetpack-search.php#L893
In addition to the various content fields you'd also need to search against taxonomy.author.name and taxonomy.author.slug (assuming the taxonomy is named 'author'). Details on fields are here: https://developer.wordpress.com/elasticsearch-post-doc-schema-v2/#es-mapping-post-tags
I agree though that this is a pretty annoying issue. I will be trying to fix it when we next reindex our data, but it will be at least a month or two.
This issue has been marked as stale. This happened because:
No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.
1907828-zen this customer has quite a few non-subscriber users
This issue has been marked as stale. This happened because:
No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.
Any update here?
@orenwolf I've worked on it a bit, but not yet in a state that is ready to be shipped unfortunately.
This issue has been marked as stale. This happened because:
No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.
Sounds like the PressPublish plugin also has a distinct method of storing authors which uses a taxonomy and the term relationships with links to user ids. Yet another custom way we probably need to index authors.
Our authors are stored as terms of the taxonomy "author". Those are regular WP taxonomy terms. So the relationship between the author terms and each post is added to the table "wp_term_relationships". For authors that are mapped to users (not a guest author), the term has a metadata "user_id" that links the user and the author term.
I have dozens of authors and was surprised that their names didn't show when searched.
Most helpful comment
I tested with the following steps to see if the original author's name gets attached to the post when the author is not connected to WordPress.com.
/sites/$site/posts/and check to see if the original author's name is attached to the post.Result: the author's name is present if a post is published by an author not connected to WordPress.com.
{ ID: 11, site_ID: 146008467, author: { ID: 2, login: "testuser", email: false, name: "Test User", first_name: "Test" …} …}To help further, would using the method in the following tutorial be a good way to test?
http://www.wpbeginner.com/wp-tutorials/how-to-rewrite-guest-author-name-with-custom-fields-in-wordpress/