예제 #1
0
        public async Task <IActionResult> SongSearch([FromBody] SongSearchRequest request)
        {
            try
            {
                var searchResults = await _solrService.Search(request.SearchTerms);

                return(new JsonResult(new SongSearchResponse
                {
                    SearchResults = searchResults
                }));
            }
            catch (Exception e)
            {
                _logger.LogError(e, "Error in SongSearch");
                return(BadRequest());
            }
        }
예제 #2
0
 public IActionResult SolrSearch(string searchText)
 {
     try
     {
         return(Ok(_solrService.Search(searchText)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }