for my current project I need to implement a search functionality, that combines both the content search and the user search.
This raises several issues, for example relevance. Nodes have a relevance when searched, and users do not.
Now, I was thinking how to tackle this the best way. To my knowledge, I have several options :
hook search, and use the do_search function twice, once for nodes, once for users, and combine both results. However, this messes up the paging I presume. Thi开发者_Python百科s seems my best bet.
hook search, and use the do_search's capability to combine both a node and a user search. do_search can combine 2 queries, but I'm not sure how this exactly works.
hook search, and write to whole stuff by hand, but that I would rather not do.
Any suggestions ? Is there someone who has done this before ?
Many thanks!
content_profile exposes user data in a node so you would just need one search
An option which would not require converting user profiles to nodes is the excellent https://www.drupal.org/project/search_by_page (enable the node and user search components; no need to use its signature paths component)
精彩评论