public ActionResult AddProduct() { var p = new ElasticSearchProduct { Id = Guid.NewGuid(), Format = "E-book" }; this.Search.IndexProduct( p ); this.TempData.Add( "Post", "Product added." ); return Redirect( "index" ); }
public void IndexProduct( ElasticSearchProduct p ) { this.ElasticSearch.Map<ElasticSearchProduct>(); this.ElasticSearch.Index<ElasticSearchProduct>( p ); }