Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Integrating ASP results with BuddyBoss Search Component's Results Template › Reply To: Integrating ASP results with BuddyBoss Search Component's Results Template
After digging more into the BB search component search, it seems like it is pretty complicated with dozens of files and functions. I’m also not quite sure how intertwined it is with the rest of BB, so I am hesitant to make a duplicate/alternate version of it. Therefore, I think the first option would be ideal – try to use the BB search code as much as possible and just replace its query with ASP’s query and results.
The filter mentioned in the previous reply only allows me to modify the results, and there doesn’t appear to be a way to prevent the (very inefficient, redundant) BB queries from being run to begin with.
So, for now, I will just directly modify the BB Plugin code and then monitor future releases for changes to merge with these files.
I have attached a file that contains the 3 relevant functions:
1. bp_search_search_page_content() – gets called by a filter on the_content and checks if the current page is a search query and then calls the next function.
2. prepare_search_page() – sets some args and then calls the main search function, generally just passing the search term along as the sole argument.
3. do_search()
– dynamically loops through about 15 different search helper files to generate sql queries which then get combined into $pre_search_query on line 182, and then the $results are generated on line 188.
– It then generates groups and creates HTML for each group and result.
I have confirmed that if I use “?s={phrase}&bp_search=1&view=content” as ASP’s Custom Redirect URL, it will initiate the first function above. So, it seems to me that all I need to do is delete/comment out between line 158 and 190 – the section that creates and runs the queries – and somehow pass the ASP results to this.
So, two questions:
1. Do you have a suggestion for another approach?
2. If not, how can I pass the ASP results to the do_search () function?
Thanks!