Пример #1
0
        public List <BuildingDTO> Search(SearchFilterDTO filter)
        {
            try
            {
                _logger?.LogInformation($"Starting search into Elasticsearch {JsonConvert.SerializeObject(filter)}...");

                var result = _buildingRepository.FindBuildings(filter.Phrase, filter.Market, filter.Limit);

                _logger?.LogInformation($"The search result was {result.Count} records");

                return(result.ProjectedAsCollection <BuildingDTO>());
            }
            catch (Exception ex)
            {
                _logger?.LogError(ex.Message);
                throw new Exception(ex.Message);
            }
        }