Ejemplo n.º 1
0
        public IActionResult SearchHandle()
        {
            string Query = Request.Form["Query"];

            ViewBag.Query = Query;
            int noAlgos  = 3;
            var client   = new WebSearchClient(new ApiKeyServiceClientCredentials("8d3129ea335440da904641c7cc055494"));
            var response = BingSearchHelper.WebResults(client, Query, noAlgos);

            //-------------test
            List <RootQueryCandidate> rqCandidates = _context.getQueryCandidates();

            //----------------
            return(View(response));
        }
Ejemplo n.º 2
0
        public IActionResult Index(string Query)
        {
            ViewBag.Query = Query;
            int noAlgos  = 10;
            var client   = new WebSearchClient(new ApiKeyServiceClientCredentials("8d3129ea335440da904641c7cc055494"));
            var response = BingSearchHelper.WebResults(client, Query, noAlgos);

            //-------------test
            List <RootQueryCandidate> rqCandidates = _context.getQueryCandidates();
            //_context.answerid_pwqueries_selection.Add(new RootQueryCandidate { answerid = "a", impression = 1, judgedetails = "", pwquery = "testa1", selected = "false" });
            //_context.answerid_pwqueries_selection.Add(new RootQueryCandidate { answerid = "a", impression = 2, judgedetails = "", pwquery = "testa2", selected = "false" });
            //_context.answerid_pwqueries_selection.Add(new RootQueryCandidate { answerid = "a", impression = 3, judgedetails = "", pwquery = "testa3", selected = "false" });
            //_context.answerid_pwqueries_selection.Add(new RootQueryCandidate { answerid = "b", impression = 2, judgedetails = "", pwquery = "testb2", selected = "false" });
            //_context.SaveChanges();
            //----------------
            var results = _context.url_pwqueries_selection.Where(q => q.selectedanswerid == "a").OrderByDescending(i => i.impression);

            return(View(response.Result));
        }