public bool UpdateSearchRoute(string routeName, string updateKey)
 {
     bool success = false;
     InfinityEngine.Business.InfinityEngine infinityEngine = new InfinityEngine.Business.InfinityEngine();
     success = infinityEngine.UpdateFullCache(routeName, updateKey);
     if (success)
     {
         success = false;
         infinityEngine.UpdateAutoCompleteCache(routeName);
         success = true;
     }
     return success;
 }
        public void TestUpdateAutoCompleteCache()
        {
            Configuration config = new Configuration();
            config.AutoCompleteRoute = "testRoute";
            config.MaxResults = 100;
            config.RecordIndentifier = "Code";
            config.UpdateURL = "http://urltoupdatefrom";

            BasicRedisClientManager pooledClientManager = RedisClientManager.get();
            using (IRedisClient redisClient = pooledClientManager.GetClient())
            {
                IRedisTypedClient<Configuration> redis = redisClient.As<Configuration>();
                redis.SetEntry(config.AutoCompleteRoute, config);

                Dictionary<string,string> dataObj = new Dictionary<string,string>();
                dataObj["Code"] = "foo";
                dataObj["Desc"] = "bar";
                redisClient.Lists["cacheIndex:" + config.AutoCompleteRoute].Add(dataObj[config.RecordIndentifier]);
                redisClient.SetEntry("fullCache:" + config.AutoCompleteRoute + ":" + dataObj[config.RecordIndentifier], JsonConvert.SerializeObject(dataObj));
            }

            InfinityEngine.Business.InfinityEngine infinityEngine = new InfinityEngine.Business.InfinityEngine();
            infinityEngine.UpdateAutoCompleteCache(config.AutoCompleteRoute);

            using (IRedisClient redisClient = pooledClientManager.GetClient())
            {
                string setName = config.AutoCompleteRoute + ":autocomplete:ba";
                List<string> setValues = redisClient.SortedSets[setName].GetAll();

                Assert.IsTrue(setValues.Count > 0);
            }
        }