-
Notifications
You must be signed in to change notification settings - Fork 314
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
BuddyPress Integration #3
Comments
We have a client who wants multifaceted member profile search right now. This would be great. |
This. So much this. I could really use faceted search at the moment. How can I extend ElasticPress to integrate |
I'm also kicking off a BuddyPress integration project for a site. Do we have enough interested parties here to collaborate on an ElasticPress solution or? |
Here's what I ended up with last year, if it helps: https://github.com/swissspidy/wptalents/blob/feature/buddypress-integration/classes/core/ElasticPress.php |
If someone wants to package the BuddyPress integration into a feature, that would be awesome. |
I just found this repo https://github.com/MESH-Research/elasticpress-buddypress that offers a seemingly-maintained ElasticPress-BuddyPress Feature, though it is missing a lot of key functionality. I'm quite eager to get this working in a fairly comprehensive way with automatic index updating for Groups, Members, Activity, Messages, as well as the BuddyBoss additions of Media, Documents etc... I'm reasonably competent with BuddyPress/bbPress/BuddyBoss, but am brand new to ElasticSearch/Press so don't really have a grasp of how to do all of this. At a glance, the MESH Feature seems to be using some out-of-date mechanisms when comparing to the Feature API @mikethicke (from the MESH Repo), @swissspidy (from the WPTalents Repo) and anyone else here from the ElasticPress team or otherwise - if you could you give me some guidance, I'd be more than happy to do the legwork in updating and filling out the Feature! |
As much as I would like to help you, I have used neither BuddyPress nor ElasticPress for over 6 years. |
I've gotten some good feedback from @mikethicke over in his repo and will take a crack at writing a new feature that brings his BP-specific mechanisms to an existing core-EP Feature template. When there is something worth getting feedback on, I'll create a pull request to this repo and mention it here. Hopefully I/we can get this to work soon enough! It really would be an enormously useful tool for either large BP networks or just any BP network that also has a lot of posts and documents to index and search! |
I've made some progress on this (mostly just debugging Boone's fork/update of one of the EP-BP plugins mentioned above, such that the BP Groups indexing now works with the Indexables and Features APIs). I then hit a roadblock when I discovered that EP doesn't automatically allow for a multi-index search (or even just a non-Posts search), as described in this issue #2844. However, I think it was fortuitous as it forced me to rethink everything and I believe I've found a fairly ideal solution to all of this! If I'm not mistaken, the essence of EP is that it allows WordPress to remain as it is, but simply replaces a heavy SQL query with a faster, drop-in, ES query. Once the results are generated, the PHP/SQL resumes, doing whatever it needs to do to display the results page loop. As it turns out, I'm actually a BuddyBoss user, rather than BuddyPress, and BB created a BP Global Search plugin 7+ years ago (about 6 months after this Issue was created!), which continues to be updated as part of the BB Platform. It handles all the heavy lifting of integrating with/overriding a WP search, generating the various queries and conditions for each data type, and then displaying the results in an attractive and functional search results page. So, I don't see why I can't just allow it to do its thing, but replace the SQL query with an ES query. It would surely need some modifications to work with BuddyPress/bbPress, but that seems like a relatively minor task that someone else can figure out later. Here's an excerpt of an SQL query generated by it:
As you can see, it pre-generates a bunch of search conditions (for post privacy settings (public, friends, onlyme), group privacy (public, private, hidden), suspended/moderated user/post, etc...) via SQL queries and/or persistent Object Cache. I don't see any reason why I should interfere with, let alone attempt to replicate, any of that. All of the pre-queries will likely preclude EP Autosuggest, but so be it. It has built-in AJAX search capabilities, which mostly uses the exact same mechanism, so that should suffice. (I also suspect replacing UNION with UNION ALL and getting rid of DISTINCT could improve performance...) I assume it will be no problem at all to add the various metadata/fields that are used in the SQL queries to the ES documents via a JSON mapping. Likewise, I suspect it won't be terribly difficult to convert the SQL query clauses into ES-friendly query args. It may prove a bit trickier to properly update/sync changes with EP, but I can worry about that later. My main question is the following: Given that the BuddyBoss code will be handling the override/hijacking of the WordPress search mechanism, which EP functions and filters should I be looking at in order to initiate an ES query, create the args etc…? Is it just I'm not particularly concerned with how long it might take to achieve all of this - I'm enjoying learning how this all works and would also just like to give back something meaningful to BP/EP/WP. I just hope you fine folks can help nudge me in the right direction! Thanks! (@felipeelia, I hope you don't mind me tagging you here as a follow-up from my question in #2844) |
BuddyPress components would hugely benefit from indexing of their content:
The above list is loosely in priority order as I see it. Users ask for multifaceted member profile search constantly, and there just isn't a real solution out there.
The text was updated successfully, but these errors were encountered: