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()); } }
public IActionResult SolrSearch(string searchText) { try { return(Ok(_solrService.Search(searchText))); } catch (Exception e) { return(BadRequest(e.Message)); } }