/// <summary>
 /// supprime un blogpostcomment
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public bool get_blogpostcomment(string id = "")
 {
     if (id == "" || id == null) return false;
     blogController controller = new blogController();
     controller.RemoveBlogPostComment(id);
     return true;
 }
        /// <summary>
        /// Fait une recherche générale dans tout les index grâce au param keyword
        /// </summary>
        /// <param name="keyword"></param>
        /// <param name="from"></param>
        /// <param name="take"></param>
        /// <returns></returns>
        public GenericResponse get(string keyword, int from = 0, int take=20)
        {
          //  var nvc = HttpUtility.ParseQueryString(Request.RequestUri.Query);
            if(keyword.Contains("%20")){
                keyword.Replace("%20", " ");
            }
            keyword = keyword.ToLower();
            GenericResponse myReturn = new GenericResponse();
            
            //Search in Profiles
            profilesController Pcontroller = new profilesController();
            myReturn.Gprofile = Pcontroller.SimpleSearchProfile(keyword, from, take).Hits;            

            //Search in Blogs
            blogController Bcontroller = new blogController();
            myReturn.Gblog = Bcontroller.SimpleSearchBlog(keyword, from, take).Hits;
            myReturn.Gblogpost = Bcontroller.SimpleSearchBlogPost(keyword, from, take).Hits;
            myReturn.Gblogpostcomment = Bcontroller.SimpleSearchBlogComment(keyword, from, take).Hits;
            
            //Search in Events
            eventsController Econtroller = new eventsController();
            myReturn.Gevent = Econtroller.SimpleSearchEvent(keyword, from, take).Hits;

            //Search in Places
            placesController PLcontroller = new placesController();
            myReturn.Gplace = PLcontroller.SimpleSearchPlace(keyword, from, take).Hits;

            //Search in Forum
            forumController Fcontroller = new forumController();
            myReturn.Gpostforum = Fcontroller.SimpleSearchPostForum(keyword, from, take).Hits;

            return myReturn;
        }
 /// <summary>
 /// Met à jour un blogpostcomment
 /// </summary>
 /// <param name="id"></param>
 /// <param name="content"></param>
 /// <param name="author"></param>
 /// <returns></returns>
 public bool get_blogpostcomment(string id="", string content="", string author="")
 {
     BlogPostComment XNewBlogPostComment = new BlogPostComment(id, content, author);
     blogController controller = new blogController();
     controller.UpdateBlogPostComment(XNewBlogPostComment);
     return true;
 }
 /// <summary>
 /// Met à jour un blog
 /// </summary>
 /// <param name="id"></param>
 /// <param name="content"></param>
 /// <param name="category"></param>
 /// <returns></returns>
 public bool get_blog(string id="", string content="", string category="")
 {
     Blog XNewBlog = new Blog(id, content, category);
     blogController controller = new blogController();
     controller.UpdateBlog(XNewBlog);
     return true;
 }
Beispiel #5
0
 /// <summary>
 /// Ajoute un index blogpost
 /// </summary>
 /// <param name="id"></param>
 /// <param name="content"></param>
 /// <param name="author"></param>
 /// <param name="title"></param>
 /// <returns></returns>
 public bool get_blogpost(string id = "", string content = "", string author = "", string title ="")
 {
     BlogPost XBlogPost = new BlogPost(id, content, author, title);
     blogController controller = new blogController();
     controller.AddBlogPost(XBlogPost);
     return true;
 }
Beispiel #6
0
 public void TestInitialize()
 {
     client = YoupElasticSearch.InitializeConnection();
     controllerEvent = new eventsController();
     controllerProfile = new profilesController();
     controllerPlace = new placesController();
     controllerForum = new forumController();
     controllerBlog = new blogController();
 }
        /// <summary>
        /// Non fonctionnel
        /// </summary>
        /// <param name="keyword"></param>
        /// <param name="from"></param>
        /// <param name="take"></param>
        /// <param name="author"></param>
        /// <returns></returns>
        public GenericResponse get_blog(string keyword, string from, string take, string author)
        {
            if (keyword.Contains("%20"))
            {
                keyword.Replace("%20", " ");
            }
            keyword = keyword.ToLower();
           
            blogController Pcontroller = new blogController();

            //Search in blog


            GenericResponse myReturn = new GenericResponse();
            return myReturn;

        }