private ActionResult ValidateSearcher(string searcherName, out ISearcher searcher)
        {
            //try to get the searcher from the indexes
            if (_examineManager.TryGetIndex(searcherName, out IIndex index))
            {
                searcher = index.Searcher;
                return(new OkResult());
            }

            //if we didn't find anything try to find it by an explicitly declared searcher
            if (_examineManager.TryGetSearcher(searcherName, out searcher))
            {
                return(new OkResult());
            }

            var response1 = new BadRequestObjectResult($"No searcher found with name = {searcherName}");

            HttpContext.SetReasonPhrase("Searcher Not Found");
            return(response1);
        }
        private HttpResponseMessage ValidateSearcher(string searcherName, out ISearcher searcher)
        {
            //try to get the searcher from the indexes
            if (_examineManager.TryGetIndex(searcherName, out var index))
            {
                searcher = index.GetSearcher();
                return(Request.CreateResponse(HttpStatusCode.OK));
            }

            //if we didn't find anything try to find it by an explicitly declared searcher
            if (_examineManager.TryGetSearcher(searcherName, out searcher))
            {
                return(Request.CreateResponse(HttpStatusCode.OK));
            }

            var response1 = Request.CreateResponse(HttpStatusCode.BadRequest);

            response1.Content      = new StringContent($"No searcher found with name = {searcherName}");
            response1.ReasonPhrase = "Searcher Not Found";
            return(response1);
        }
        /// <summary>
        /// Get a searcher by name
        /// </summary>
        public ISearcher GetSearcher(string name)
        {
            _examineManager.TryGetSearcher(name, out ISearcher searcher);

            return(searcher);
        }