Example #1
0
        /// <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;
        }
Example #2
0
 /// <summary>
 /// supprime un event
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public bool get_event(string id = "")
 {
     if (id == "" || id == null) return false;
     eventsController controller = new eventsController();
     controller.RemoveEvent(id);
     return true;
 }
Example #3
0
        public GenericResponse get_closeevents(double latitude = 0, double longitude = 0)
        {
            GenericResponse myReturn = new GenericResponse();

            eventsController Econtroller = new eventsController();
            myReturn.Gevent = Econtroller.searchCloseEvents(latitude, longitude).Hits;
            return myReturn;
        }
Example #4
0
 public void TestInitialize()
 {
     client = YoupElasticSearch.InitializeConnection();
     controllerEvent = new eventsController();
     controllerProfile = new profilesController();
     controllerPlace = new placesController();
     controllerForum = new forumController();
     controllerBlog = new blogController();
 }
Example #5
0
 /// <summary>
 /// Met à jour un event
 /// </summary>
 /// <param name="idP"></param>
 /// <param name="nameP"></param>
 /// <param name="town"></param>
 /// <param name="latitude"></param>
 /// <param name="longitude"></param>
 /// <param name="idE"></param>
 /// <param name="nameE"></param>
 /// <param name="type"></param>
 /// <param name="date"></param>
 /// <param name="adresse"></param>
 /// <returns></returns>
 public bool get_event(string idP = "", string nameP = "", string town = "", decimal? latitude = 0, decimal? longitude = 0,
     string idE = "", string nameE = "", long type = 0L, DateTime date = new DateTime(), string adresse = "")
 {
     Place XNewPlace = new Place(idP, nameP, town, latitude, longitude);
     Event XNewEvent = new Event(idE, nameE, type, date, XNewPlace, adresse);
     eventsController controller = new eventsController();
     controller.UpdateEvent(XNewEvent);
     return true;
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="from"></param>
 /// <param name="take"></param>
 /// <param name="keyword"></param>
 /// <param name="type"></param>
 /// <param name="town"></param>
 /// <param name="date"></param>
 /// <returns></returns>
 public GenericResponse get_event(int from=0, int take=20, string keyword="", string type="", string town="", DateTime? date=null)
 {
     if (keyword.Contains("%20"))
     {
         keyword.Replace("%20", " ");
     }
     keyword = keyword.ToLower();
     town = town.ToLower();
     GenericResponse myReturn = new GenericResponse();
     //Search in Forum
     eventsController Pcontroller = new eventsController();
     myReturn.Gevent = Pcontroller.AdvancedSearchEvent(from, take, keyword, type, town, date).Hits;
      
     return myReturn;
 }