|  | @@ -24,7 +24,7 @@ import org.elasticsearch.search.sort.SortOrder;
 | 
	
		
			
				|  |  |  import static org.elasticsearch.index.query.QueryBuilders.termQuery;
 | 
	
		
			
				|  |  |  import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -public class UpdateByQueryBasicTests extends UpdateByQueryTestCase {
 | 
	
		
			
				|  |  | +public class UpdateByQueryBasicTests extends ReindexTestCase {
 | 
	
		
			
				|  |  |      public void testBasics() throws Exception {
 | 
	
		
			
				|  |  |          indexRandom(true, client().prepareIndex("test", "test", "1").setSource("foo", "a"),
 | 
	
		
			
				|  |  |                  client().prepareIndex("test", "test", "2").setSource("foo", "a"),
 | 
	
	
		
			
				|  | @@ -35,26 +35,28 @@ public class UpdateByQueryBasicTests extends UpdateByQueryTestCase {
 | 
	
		
			
				|  |  |          assertEquals(1, client().prepareGet("test", "test", "4").get().getVersion());
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          // Reindex all the docs
 | 
	
		
			
				|  |  | -        assertThat(request().source("test").refresh(true).get(), responseMatcher().updated(4));
 | 
	
		
			
				|  |  | +        assertThat(updateByQuery().source("test").refresh(true).get(), updateByQueryResponseMatcher().updated(4));
 | 
	
		
			
				|  |  |          assertEquals(2, client().prepareGet("test", "test", "1").get().getVersion());
 | 
	
		
			
				|  |  |          assertEquals(2, client().prepareGet("test", "test", "4").get().getVersion());
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          // Now none of them
 | 
	
		
			
				|  |  | -        assertThat(request().source("test").filter(termQuery("foo", "no_match")).refresh(true).get(), responseMatcher().updated(0));
 | 
	
		
			
				|  |  | +        assertThat(updateByQuery().source("test").filter(termQuery("foo", "no_match")).refresh(true).get(),
 | 
	
		
			
				|  |  | +                updateByQueryResponseMatcher().updated(0));
 | 
	
		
			
				|  |  |          assertEquals(2, client().prepareGet("test", "test", "1").get().getVersion());
 | 
	
		
			
				|  |  |          assertEquals(2, client().prepareGet("test", "test", "4").get().getVersion());
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          // Now half of them
 | 
	
		
			
				|  |  | -        assertThat(request().source("test").filter(termQuery("foo", "a")).refresh(true).get(), responseMatcher().updated(2));
 | 
	
		
			
				|  |  | +        assertThat(updateByQuery().source("test").filter(termQuery("foo", "a")).refresh(true).get(),
 | 
	
		
			
				|  |  | +                updateByQueryResponseMatcher().updated(2));
 | 
	
		
			
				|  |  |          assertEquals(3, client().prepareGet("test", "test", "1").get().getVersion());
 | 
	
		
			
				|  |  |          assertEquals(3, client().prepareGet("test", "test", "2").get().getVersion());
 | 
	
		
			
				|  |  |          assertEquals(2, client().prepareGet("test", "test", "3").get().getVersion());
 | 
	
		
			
				|  |  |          assertEquals(2, client().prepareGet("test", "test", "4").get().getVersion());
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          // Limit with size
 | 
	
		
			
				|  |  | -        UpdateByQueryRequestBuilder request = request().source("test").size(3).refresh(true);
 | 
	
		
			
				|  |  | +        UpdateByQueryRequestBuilder request = updateByQuery().source("test").size(3).refresh(true);
 | 
	
		
			
				|  |  |          request.source().addSort("foo.keyword", SortOrder.ASC);
 | 
	
		
			
				|  |  | -        assertThat(request.get(), responseMatcher().updated(3));
 | 
	
		
			
				|  |  | +        assertThat(request.get(), updateByQueryResponseMatcher().updated(3));
 | 
	
		
			
				|  |  |          // Only the first three documents are updated because of sort
 | 
	
		
			
				|  |  |          assertEquals(4, client().prepareGet("test", "test", "1").get().getVersion());
 | 
	
		
			
				|  |  |          assertEquals(4, client().prepareGet("test", "test", "2").get().getVersion());
 |