public IndexedLocation GetLocation(Guid LocationKey) { //OLD //var result = Repositories.LocationRepo.GetByKey(LocationKey); //search for the Key in the Index var searcher = locationIndexManager.uLocateLocationSearcher(); var searchCriteria = searcher.CreateSearchCriteria(); var query = searchCriteria.Field("Key", LocationKey.ToString()); var searchResults = searcher.Search(query.Compile()); var searchedLocations = uLocate.Helpers.Convert.ExamineToSearchedLocations(searchResults); var result = searchedLocations.Select(n => n.IndexedLocation).FirstOrDefault(); return(result); }
//Set some default values public SearchParameters() { LocationIndexManager locationIndexManager = new LocationIndexManager(); this.SearchProperties = new List <SearchProperty> { new SearchProperty(locationIndexManager.AllDataFieldName) }; this.IndexTypes = new List <string> { locationIndexManager.IndexTypeName }; this.SearchProvider = locationIndexManager.uLocateLocationSearcher().Name; }