public async Task <SpecificationDatasourceRelationshipSearchResultViewModel> PerformSearch(SearchRequestViewModel request)
        {
            SearchFilterRequest requestOptions = new SearchFilterRequest()
            {
                Page          = request.PageNumber.HasValue ? request.PageNumber.Value : 1,
                PageSize      = request.PageSize.HasValue ? request.PageSize.Value : 50,
                SearchTerm    = request.SearchTerm,
                IncludeFacets = false,
                Filters       = request.Filters,
            };

            if (request.PageNumber.HasValue && request.PageNumber.Value > 0)
            {
                requestOptions.Page = request.PageNumber.Value;
            }

            PagedResult <SpecificationDatasourceRelationshipSearchResultItem> pagedResult = await _specsClient.FindSpecificationAndRelationships(requestOptions);

            if (pagedResult == null)
            {
                _logger.Error("Find specification data source relationships HTTP request failed");
            }

            SpecificationDatasourceRelationshipSearchResultViewModel viewModel = new SpecificationDatasourceRelationshipSearchResultViewModel();

            viewModel.TotalResults = pagedResult.TotalItems;
            viewModel.CurrentPage  = pagedResult.PageNumber;

            IList <SpecificationDatasourceRelationshipSearchResultItemViewModel> itemResults = new List <SpecificationDatasourceRelationshipSearchResultItemViewModel>();

            foreach (SpecificationDatasourceRelationshipSearchResultItem item in pagedResult.Items)
            {
                itemResults.Add(new SpecificationDatasourceRelationshipSearchResultItemViewModel
                {
                    SpecificationId   = item.Id,
                    SpecificationName = item.Name,
                    CountPhrase       = BuildCountPhrase(item.RelationshipCount)
                });
            }

            IEnumerable <SpecificationDatasourceRelationshipSearchResultItemViewModel> sortedResults = itemResults.OrderBy(f => f.SpecificationName);

            viewModel.SpecRelationships = sortedResults.ToList();

            if (viewModel.TotalResults == 0)
            {
                viewModel.StartItemNumber = 0;
                viewModel.EndItemNumber   = 0;
            }
            else
            {
                viewModel.StartItemNumber = ((requestOptions.Page - 1) * requestOptions.PageSize) + 1;
                viewModel.EndItemNumber   = viewModel.StartItemNumber + requestOptions.PageSize - 1;
            }

            if (viewModel.EndItemNumber > pagedResult.TotalItems)
            {
                viewModel.EndItemNumber = pagedResult.TotalItems;
            }

            viewModel.PagerState = new PagerState(requestOptions.Page, pagedResult.TotalPages, 4);

            return(viewModel);
        }