User Search plugin consists of two parts: Quick Search and Advanced Search.
Quick search is aimed at providing site users a simple way of getting to search results without any restrictions. Functionality behind quick search is not attached to authentication data. Thus, quick search form doesn't know anything about searcher: both guests and logged in users are treated equally as “visitors”. Therefore quick search form, unlike advanced search, always allows any visitor to select his/her gender.
Advanced search form is aimed at providing user an ability to find users based on wider range of search criteria. Functionality behind advanced search is attached to authentication data.
Both quick and advanced searches involve two parties:
User Search plugin is designed in a way to bring search results that meet interests of both searcher and searchee.
Outcome: raw search results.Raw search results are not yet visible to searchers and include list of potential searchees.
Outcome: secondary search results. Secondary search results are not visible to searchers.
Outcome: final search results. Final search results are visible to searchers.
Male user is searching for females.
Raw search results: system finds all female users
Secondary search results: system checks each found female user and fetches data about whom those female users are looking for. If female user is looking for females - this user will be excluded from search results, since searcher is male. If female user is looking for males- this user is included into secondary search results.
Final search results: system checks whether filtered female users looking for males match rest of the search criteria. Those search results are displayed to searcher.