static void Main(string[] args) { MeetupEvents events = new MeetupEvents(); events.description = "我是erwerwerw"; events.eventid = 2; events.eventname = "我是xxxxdfsd"; events.orignalid = "2"; ESProvider provider = new ESProvider(); provider.PopulateIndex(events); var result = provider.GetResult_TermQuery("我是事件"); Console.WriteLine(result.ToString()); Console.WriteLine(result.Count()); Console.ReadLine(); }
public bool PopulateIndex(MeetupEvents meetupevent) { var index = client.Index(meetupevent, i => i.Index(strIndexName).Type(strDocType).Id(meetupevent.eventid)); return(index.Created); }