/// <summary> /// PUT api/indexes /// </summary> /// <param name="index"></param> /// <returns></returns> public async Task <HttpResponseMessage> Put(Index index) { var result = await _managementClient.UpdateIndexAsync(index); if (!result.IsSuccess) { return(Request.CreateResponse(result.StatusCode, result)); } return(Request.CreateResponse(HttpStatusCode.OK, result)); }
public override void Execute(ApiConnection db) { var client = new IndexManagementClient(db); var result = client.UpdateIndexAsync(new Index("plopindex") .WithStringField("Id", f => f .IsKey() .IsRetrievable()) .WithStringField("PlopField", f => f .IsSearchable() .IsRetrievable()) .WithStringField("AddedField", f => f .IsSearchable() .IsRetrievable()) .WithDateTimeField("SomeTime", f => f .IsRetrievable())).Result; if (!result.IsSuccess) { throw new ApplicationException("Could not create plopindex index: " + result.Error.Message); } }