Example #1
0
        public string MyQuestions(string OwnerUserId)
        {
            var elasticService = new ElasticSearchHttpService();
            var result         = elasticService.QuestionsByUser(OwnerUserId);

            return(result);
        }
Example #2
0
        // POST: api/Search
        public HttpResponseMessage Post(Post post)
        {
            var    elasticService = new ElasticSearchHttpService();
            string result         = elasticService.MoreLikeThisContent(post.Body, post.PostTypeId.ToString());

            return(this.Request.CreateResponse(HttpStatusCode.OK, result));
        }
Example #3
0
        public HttpResponseMessage Post(Document document)
        {
            var    elasticService = new ElasticSearchHttpService();
            string result         = elasticService.InsertDocument(document);

            return(this.Request.CreateResponse(HttpStatusCode.OK, result));
        }
Example #4
0
        // DELETE: api/Document/5
        public HttpResponseMessage Delete(int id)
        {
            var elasticService = new ElasticSearchHttpService();

            elasticService.DeleteDocument(id);
            return(this.Request.CreateResponse(HttpStatusCode.OK));
        }
Example #5
0
        // GET: api/Document/5
        public string Get(int id)
        {
            var elasticService = new ElasticSearchHttpService();
            var result         = elasticService.AsnwersForQuestion(id);

            return(result);
        }