Class PostgresSearchService

java.lang.Object
org.localify.search.PostgresSearchService
All Implemented Interfaces:
SearchService

@Service public class PostgresSearchService extends Object implements SearchService
A search service that uses PostgreSQL for searching.
  • Constructor Details

    • PostgresSearchService

      public PostgresSearchService(VenueRepository venueRepository, EventRepository eventRepository, ArtistRepository artistRepository, CityRepository cityRepository, SpotifyService spotifyService, PlaylistService playlistService, LocalifyProperties properties, CityService cityService, VenueService venueService, AppleGeocoding appleGeocoding, PointUtil pointUtil, GoogleDispatch googleDispatch, FestivalRepository festivalRepository)
      Constructs a new PostgresSearchService.
      Parameters:
      venueRepository - The venue repository.
      eventRepository - The event repository.
      artistRepository - The artist repository.
      cityRepository - The city repository.
      spotifyService - The Spotify service.
      playlistService - The playlist service.
      properties - The application properties.
      cityService - The city service.
      venueService - The venue service.
      appleGeocoding - The Apple geocoding service.
      pointUtil - The point utility.
      googleDispatch - The Google dispatch service.
      festivalRepository - The festival repository.
  • Method Details

    • searchArtists

      @Transactional public List<BasicArtistResponse> searchArtists(SearchQuery request, boolean autoSearchSpotify)
      Description copied from interface: SearchService
      Searches for artists using a search query.
      Specified by:
      searchArtists in interface SearchService
      Parameters:
      request - the search request dto
      autoSearchSpotify - whether to automatically search Spotify if no results are found
      Returns:
      list of artist responses - can be empty. Never null.
    • searchCities

      @Transactional public List<CityResponse> searchCities(SearchQuery request)
      Description copied from interface: SearchService
      Searches cities using a query.
      Specified by:
      searchCities in interface SearchService
      Parameters:
      request - the search query dto
      Returns:
      list of city responses - can be empty. Never null.
    • searchVenues

      @Transactional public List<VenueResponse> searchVenues(SearchQuery request)
      Description copied from interface: SearchService
      Searches for venues using a search query.
      Specified by:
      searchVenues in interface SearchService
      Parameters:
      request - the search request dto
      Returns:
      list of venue responses - can be empty. Never null.
    • searchEvents

      @Transactional public List<EventResponse> searchEvents(SearchQuery request)
      Description copied from interface: SearchService
      Searches for events using a search query.
      Specified by:
      searchEvents in interface SearchService
      Parameters:
      request - the search request dto
      Returns:
      list of event responses - can be empty. Never null.
    • searchFestivals

      @Transactional(readOnly=true) public List<FestivalResponse> searchFestivals(SearchQuery request)
      Description copied from interface: SearchService
      Searches for festivals using a search query.
      Specified by:
      searchFestivals in interface SearchService
      Parameters:
      request - the search request dto
      Returns:
      list of festival responses - can be empty. Never null.
    • searchAll

      @Transactional public SearchApiResponse searchAll(SpotifySearchQuery request)
      Searches for all types of entities.
      Specified by:
      searchAll in interface SearchService
      Parameters:
      request - The search query.
      Returns:
      A response containing lists of all found entities.