NEST API UpdateByQuery

Update By Query API is supported in NEST. Here's an example adapted from the integration tests

private static void Main()
{
	var pool = new SingleNodeConnectionPool(new Uri("http://localhost:9200"));

    var settings = new ConnectionSettings(pool)
		.DefaultMappingFor<Test>(m => m
			.IndexName("tests")
			.TypeName("test")
		);

    var client = new ElasticClient(settings);
	var index = IndexName.From<Test>();
	
	if (client.IndexExists(index).Exists)
		client.DeleteIndex(index);

	client.CreateIndex(index, c => c
		.Mappings(m => m
			.Map<Test>(map => map
				.Properties(props => props
					.Text(s => s.Name(p => p.Text))
					.Keyword(s => s.Name(p => p.Flag))
				)
			)
		)
	);

	client.Bulk(b => b
		.IndexMany(new[] {
			new Test { Text = "words words", Flag = "bar" },
			new Test { Text = "words words", Flag = "foo" }
		})
		.Refresh(Refresh.WaitFor)
	);
	
	client.Count<Test>(s => s
		.Query(q => q
			.Match(m => m
				.Field(p => p.Flag)
				.Query("foo")
			)
		)
	);
	
	client.UpdateByQuery<Test>(u => u
		.Query(q => q
			.Term(f => f.Flag, "bar")
		)
		.Script("ctx._source.flag = 'foo'")
		.Conflicts(Conflicts.Proceed)
		.Refresh(true)
	);

	client.Count<Test>(s => s
		.Query(q => q
			.Match(m => m
				.Field(p => p.Flag)
				.Query("foo")
			)
		)
	);
}

public class Test
{
	public string Text { get; set; }
	public string Flag { get; set; }
}

Observe that the count from the first Count API call is 1, and on the second Count API call after the Update By Query API call, it's 2.