// GET: api/Classifieds public List <PersonElasticSerchModel> Get() { ElasticSearchSample obj = new ElasticSearchSample(); var result = obj.GetResult(); return(result); //Code for retrive data from mongodb //MongoClient server = new MongoClient("mongodb://127.0.0.1"); //database = server.GetDatabase("test"); //var collection = database.GetCollection<Person>("testclassified"); //var filterCondition = Builders<Person>.Filter.Empty; //var entity = database.GetCollection<Person>("testclassified").Find<Person>(filterCondition).ToList(); //return entity.ToList(); }
// GET: api/Classifieds/5 public List <PersonElasticSerchModel> Get(string textsearch) { ElasticSearchSample obj = new ElasticSearchSample(); return(obj.GetResult(textsearch)); }