Exemple #1
0
        public ActionResult TestLoad()
        {
            //   ElastaTools.LoadDirectorsTest();

            var movies = ElastaTools.GetImdbMovieListings();

            ElastaTools.LoadCollectionInfoIndex(movies, ElastaTools.GetElasticClient(GetDemoIndexName()),
                                                GetDemoIndexName());

            return(Content("Data has been loaded"));
        }
Exemple #2
0
        public ActionResult Index(MovieSearchViewModel vm)
        {
            var client        = ElastaTools.GetElasticClient(GetDemoIndexName());
            var searchRequest = ElastaTools.BuildSearchRequest(vm);

            vm.QueryResults = ElastaTools.SearchMovies(client, GetDemoIndexName(), searchRequest);
            vm.FoundMovies  = vm.QueryResults.Documents.ToList();
            vm.QueryJson    = client.RequestResponseSerializer.SerializeToString(searchRequest);


            return(View(vm));
        }