Exemplo n.º 1
0
        public void RemoveDocuments(string indexName, IEnumerable <IDocument> documents)
        {
            var amazonSearchParameters          = this.GetAmazonParams();
            CloudSearch <AmazonDoc> cloudSearch = new CloudSearch <AmazonDoc>(amazonSearchParameters[DocumentEndPoint], amazonSearchParameters[ApiVersion]);
            var result = cloudSearch.Delete(documents.Select(d => new AmazonDoc(d)).ToList());

            if (result.IsError)
            {
                Log.Write(string.Format("Failed to remove documents from search index '{0}'. Errors: {1}", indexName, this.GenerateErrorMessage(result)), ConfigurationPolicy.ErrorLog);
            }
        }
        public void TestCRUD()
        {
            var cloudSearch = new CloudSearch<Movie>("YOU_AMAZON_CLOUD_SEARCH_KEY", "2011-02-01");

            var movie = new Movie { id = "fjuhewdijsdjoi", title = "simple title", year = 2012, mydate = DateTime.Now, actor = new List<string> { "good actor1", "good actor2" }, director = "martin magakian" };

            cloudSearch.Add(movie);

            Thread.Sleep(1000);

            movie.title = "In the skin of Amazon cloud search";
            cloudSearch.Update(movie);

            Thread.Sleep(1000);

            cloudSearch.Delete(movie);
        }
Exemplo n.º 3
0
        public void TestCRUD()
        {
            var cloudSearch = new CloudSearch <Movie>("YOU_AMAZON_CLOUD_SEARCH_KEY", "2011-02-01");

            var movie = new Movie {
                id = "fjuhewdijsdjoi", title = "simple title", year = 2012, mydate = DateTime.Now, actor = new List <string> {
                    "good actor1", "good actor2"
                }, director = "martin magakian"
            };

            cloudSearch.Add(movie);

            Thread.Sleep(1000);

            movie.title = "In the skin of Amazon cloud search";
            cloudSearch.Update(movie);

            Thread.Sleep(1000);

            cloudSearch.Delete(movie);
        }
 public void RemoveDocuments(string indexName, IEnumerable<IDocument> documents)
 {
     CloudSearch<AmazonDoc> cloudSearch = new CloudSearch<AmazonDoc>("index2-cdduimbipgk3rpnfgny6posyzy.eu-west-1.cloudsearch.amazonaws.com", "2013-01-01");
     cloudSearch.Delete(documents.Select(d => new AmazonDoc(d)).ToList());
 }