コード例 #1
0
        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);
        }
コード例 #2
0
        //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;
        }