Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            ESProvider   esProvider = new ESProvider();
            MeetupEvents meetup     = new MeetupEvents();

            meetup.eventid     = 20180726;
            meetup.eventname   = "testupdate";
            meetup.description = "desctestupdate";
            meetup.orignalid   = "orignalidtestupdate";

            esProvider.PopulateIndex(meetup);

            List <MeetupEvents> list = new List <MeetupEvents>();

            MeetupEvents meetup1 = new MeetupEvents();

            meetup.eventid     = 20180725 - 1;
            meetup.eventname   = "test1";
            meetup.description = "desctest1";
            meetup.orignalid   = "orignalidtest1";
            list.Add(meetup1);

            MeetupEvents meetup2 = new MeetupEvents();

            meetup.eventid     = 20180725 - 2;
            meetup.eventname   = "test2";
            meetup.description = "desctest2";
            meetup.orignalid   = "orignalidtest2";
            list.Add(meetup2);

            bool result = esProvider.PopulateIndexMany(list);

            Console.WriteLine(result);

            Console.WriteLine("Hello World!");
            Console.ReadKey();
        }
Ejemplo n.º 2
0
        public bool PopulateIndex(MeetupEvents meetupevent)
        {
            var index = client.Index(meetupevent, i => i.Index(strIndexName).Type(strDocType).Id(meetupevent.eventid));

            return(index.IsValid);
        }