app/controllers/search_controller.rb
# Prepares the class members holding the results found from the query.
#
# === Params
# - query: the query string
# - entity: an entity code for the "specialized" search ('s': swimmers, 't': team, 'p': pool, 'm': meeting)
#
Prepares the class members holding the results found from the query.
Prepares the class members holding the results found from the query .
def prepare_query_results( query, entity )
    @swimmers = (entity.nil? || entity == 's') ? get_possible_swimmers( params['q'], @limitless ) : []
    logger.debug("Found #{ @swimmers.count } swimmers")
    @teams    = (entity.nil? || entity == 't') ? get_possible_teams( params['q'], @swimmers, @limitless ) : []
    logger.debug("Found #{ @teams.count } teams")
    @pools    = (entity.nil? || entity == 'p') ? get_possible_pools( params['q'], @limitless ) : []
    logger.debug("Found #{ @pools.count } pools")
    meetings_ids = (entity.nil? || entity == 'm') ? get_possible_meetings( params['q'], @limitless ) : []
    @calendarMeetingPicker = CalendarMeetingPicker.new( nil, nil, nil, meetings_ids )
    @calendarDAO = @calendarMeetingPicker.pick_meetings( 'DESC', false, current_user )
    @meetings = @calendarDAO.get_meetings
    logger.debug("Found #{ @meetings.count } meetings")
  end
def prepare_query_results ( query , entity ) @swimmers = ( entity . nil? || entity == 's' ) ? get_possible_swimmers ( params [ 'q' ] , @limitless ) : [ ] logger . debug ( "Found #{ @swimmers.count } swimmers" ) @teams = ( entity . nil? || entity == 't' ) ? get_possible_teams ( params [ 'q' ] , @swimmers , @limitless ) : [ ] logger . debug ( "Found #{ @teams.count } teams" ) @pools = ( entity . nil? || entity == 'p' ) ? get_possible_pools ( params [ 'q' ] , @limitless ) : [ ] logger . debug ( "Found #{ @pools.count } pools" ) meetings_ids = ( entity . nil? || entity == 'm' ) ? get_possible_meetings ( params [ 'q' ] , @limitless ) : [ ] @calendarMeetingPicker = CalendarMeetingPicker . new ( nil , nil , nil , meetings_ids ) @calendarDAO = @calendarMeetingPicker . pick_meetings ( 'DESC' , false , current_user ) @meetings = @calendarDAO . get_meetings logger . debug ( "Found #{ @meetings.count } meetings" ) end
Prepares the class members holding the results found from the query.
Prepares the class members holding the results found from the query .
# Get all swimmers related to the query text: # Get all teams related to the query text OR the swimmers found: # Get all swimming pools somehow related to the query text: # Get all meetings somehow related to the query text:
query
<not_specific>
entity
<not_specific>