private static void IndexPost(PostAdded message) { var settings = new ConnectionSettings(new Uri("http://localhost:9200")) .DefaultIndex("posts"); var client = new ElasticClient(settings); PostSearchEngine post = new PostSearchEngine { Id = message.Id, Title = message.Title, Body = message.Body, ShortDescription = message.ShortDescription }; var indexResponse = client.IndexDocument(post); }
private void OnPostAdded() { PostAdded?.Invoke(this, EventArgs.Empty); }