mirror of
				https://github.com/spring-projects/spring-data-elasticsearch.git
				synced 2025-10-31 06:38:44 +00:00 
			
		
		
		
	DATAES-55 - polish test cases and remove unwanted files
This commit is contained in:
		
							parent
							
								
									19105dcb70
								
							
						
					
					
						commit
						ea45aba8be
					
				| @ -0,0 +1,80 @@ | |||||||
|  | /* | ||||||
|  |  * Copyright 2014 the original author or authors. | ||||||
|  |  * | ||||||
|  |  * Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
|  |  * you may not use this file except in compliance with the License. | ||||||
|  |  * You may obtain a copy of the License at | ||||||
|  |  * | ||||||
|  |  *      http://www.apache.org/licenses/LICENSE-2.0 | ||||||
|  |  * | ||||||
|  |  * Unless required by applicable law or agreed to in writing, software | ||||||
|  |  * distributed under the License is distributed on an "AS IS" BASIS, | ||||||
|  |  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||
|  |  * See the License for the specific language governing permissions and | ||||||
|  |  * limitations under the License. | ||||||
|  |  */ | ||||||
|  | package org.springframework.data.elasticsearch.core.query; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * IndexQuery Builder | ||||||
|  |  * | ||||||
|  |  * @author Rizwan Idrees | ||||||
|  |  * @author Mohsin Husen | ||||||
|  |  */ | ||||||
|  | public class IndexQueryBuilder { | ||||||
|  | 
 | ||||||
|  | 	private String id; | ||||||
|  | 	private Object object; | ||||||
|  | 	private Long version; | ||||||
|  | 	private String indexName; | ||||||
|  | 	private String type; | ||||||
|  | 	private String source; | ||||||
|  | 	private String parentId; | ||||||
|  | 
 | ||||||
|  | 	public IndexQueryBuilder withId(String id) { | ||||||
|  | 		this.id = id; | ||||||
|  | 		return this; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	public IndexQueryBuilder withObject(Object object) { | ||||||
|  | 		this.object = object; | ||||||
|  | 		return this; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	public IndexQueryBuilder withVersion(Long version) { | ||||||
|  | 		this.version = version; | ||||||
|  | 		return this; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	public IndexQueryBuilder withIndexName(String indexName) { | ||||||
|  | 		this.indexName = indexName; | ||||||
|  | 		return this; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	public IndexQueryBuilder withType(String type) { | ||||||
|  | 		this.type = type; | ||||||
|  | 		return this; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	public IndexQueryBuilder withSource(String source) { | ||||||
|  | 		this.source = source; | ||||||
|  | 		return this; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	public IndexQueryBuilder withParentId(String parentId) { | ||||||
|  | 		this.parentId = parentId; | ||||||
|  | 		return this; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	public IndexQuery build() { | ||||||
|  | 		IndexQuery indexQuery = new IndexQuery(); | ||||||
|  | 		indexQuery.setId(id); | ||||||
|  | 		indexQuery.setIndexName(indexName); | ||||||
|  | 		indexQuery.setType(type); | ||||||
|  | 		indexQuery.setObject(object); | ||||||
|  | 		indexQuery.setParentId(parentId); | ||||||
|  | 		indexQuery.setSource(source); | ||||||
|  | 		indexQuery.setVersion(version); | ||||||
|  | 		return indexQuery; | ||||||
|  | 	} | ||||||
|  | } | ||||||
| @ -25,6 +25,8 @@ import org.junit.Test; | |||||||
| import org.junit.runner.RunWith; | import org.junit.runner.RunWith; | ||||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||||
| import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; | import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; | ||||||
|  | import org.springframework.data.elasticsearch.entities.Author; | ||||||
|  | import org.springframework.data.elasticsearch.entities.Book; | ||||||
| import org.springframework.data.elasticsearch.repositories.book.SampleElasticSearchBookRepository; | import org.springframework.data.elasticsearch.repositories.book.SampleElasticSearchBookRepository; | ||||||
| import org.springframework.test.context.ContextConfiguration; | import org.springframework.test.context.ContextConfiguration; | ||||||
| import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | ||||||
|  | |||||||
| @ -35,6 +35,7 @@ import org.springframework.data.elasticsearch.core.query.GetQuery; | |||||||
| import org.springframework.data.elasticsearch.core.query.IndexQuery; | import org.springframework.data.elasticsearch.core.query.IndexQuery; | ||||||
| import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder; | import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder; | ||||||
| import org.springframework.data.elasticsearch.core.query.SearchQuery; | import org.springframework.data.elasticsearch.core.query.SearchQuery; | ||||||
|  | import org.springframework.data.elasticsearch.entities.*; | ||||||
| import org.springframework.test.context.ContextConfiguration; | import org.springframework.test.context.ContextConfiguration; | ||||||
| import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | ||||||
| 
 | 
 | ||||||
| @ -254,7 +255,7 @@ public class NestedObjectTests { | |||||||
| 		javaAuthor.setName("javaAuthor"); | 		javaAuthor.setName("javaAuthor"); | ||||||
| 		java.setAuthor(javaAuthor); | 		java.setAuthor(javaAuthor); | ||||||
| 
 | 
 | ||||||
| 		Book spring= new Book(); | 		Book spring = new Book(); | ||||||
| 		spring.setId("2"); | 		spring.setId("2"); | ||||||
| 		spring.setName("spring"); | 		spring.setName("spring"); | ||||||
| 		Author springAuthor = new Author(); | 		Author springAuthor = new Author(); | ||||||
| @ -299,6 +300,5 @@ public class NestedObjectTests { | |||||||
| 		List<Person> persons = elasticsearchTemplate.queryForList(searchQuery, Person.class); | 		List<Person> persons = elasticsearchTemplate.queryForList(searchQuery, Person.class); | ||||||
| 
 | 
 | ||||||
| 		assertThat(persons.size(), is(1)); | 		assertThat(persons.size(), is(1)); | ||||||
| 
 |  | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  | |||||||
| @ -13,7 +13,9 @@ | |||||||
|  * See the License for the specific language governing permissions and |  * See the License for the specific language governing permissions and | ||||||
|  * limitations under the License. |  * limitations under the License. | ||||||
|  */ |  */ | ||||||
| package org.springframework.data.elasticsearch; | package org.springframework.data.elasticsearch.builder; | ||||||
|  | 
 | ||||||
|  | import org.springframework.data.elasticsearch.entities.Car; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * @author Artur Konczak |  * @author Artur Konczak | ||||||
| @ -13,9 +13,10 @@ | |||||||
|  * See the License for the specific language governing permissions and |  * See the License for the specific language governing permissions and | ||||||
|  * limitations under the License. |  * limitations under the License. | ||||||
|  */ |  */ | ||||||
| package org.springframework.data.elasticsearch; | package org.springframework.data.elasticsearch.builder; | ||||||
| 
 | 
 | ||||||
| import org.springframework.data.elasticsearch.core.query.IndexQuery; | import org.springframework.data.elasticsearch.core.query.IndexQuery; | ||||||
|  | import org.springframework.data.elasticsearch.entities.SampleEntity; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * @author Rizwan Idrees |  * @author Rizwan Idrees | ||||||
| @ -13,11 +13,12 @@ | |||||||
|  * See the License for the specific language governing permissions and |  * See the License for the specific language governing permissions and | ||||||
|  * limitations under the License. |  * limitations under the License. | ||||||
|  */ |  */ | ||||||
| package org.springframework.data.elasticsearch; | package org.springframework.data.elasticsearch.builder; | ||||||
| 
 | 
 | ||||||
| import java.math.BigDecimal; | import java.math.BigDecimal; | ||||||
| 
 | 
 | ||||||
| import org.springframework.data.elasticsearch.core.query.IndexQuery; | import org.springframework.data.elasticsearch.core.query.IndexQuery; | ||||||
|  | import org.springframework.data.elasticsearch.entities.StockPrice; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * @author Artur Konczak |  * @author Artur Konczak | ||||||
| @ -22,8 +22,8 @@ import java.io.IOException; | |||||||
| 
 | 
 | ||||||
| import org.junit.Before; | import org.junit.Before; | ||||||
| import org.junit.Test; | import org.junit.Test; | ||||||
| import org.springframework.data.elasticsearch.Car; | import org.springframework.data.elasticsearch.builder.CarBuilder; | ||||||
| import org.springframework.data.elasticsearch.CarBuilder; | import org.springframework.data.elasticsearch.entities.Car; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * @author Artur Konczak |  * @author Artur Konczak | ||||||
|  | |||||||
| @ -34,7 +34,7 @@ import org.junit.Before; | |||||||
| import org.junit.Test; | import org.junit.Test; | ||||||
| import org.mockito.Mock; | import org.mockito.Mock; | ||||||
| import org.mockito.MockitoAnnotations; | import org.mockito.MockitoAnnotations; | ||||||
| import org.springframework.data.elasticsearch.Car; | import org.springframework.data.elasticsearch.entities.Car; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * @author Artur Konczak |  * @author Artur Konczak | ||||||
|  | |||||||
| @ -28,10 +28,10 @@ import org.junit.Before; | |||||||
| import org.junit.Test; | import org.junit.Test; | ||||||
| import org.junit.runner.RunWith; | import org.junit.runner.RunWith; | ||||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||||
| import org.springframework.data.elasticsearch.ParentEntity; |  | ||||||
| import org.springframework.data.elasticsearch.ParentEntity.ChildEntity; |  | ||||||
| import org.springframework.data.elasticsearch.core.query.IndexQuery; | import org.springframework.data.elasticsearch.core.query.IndexQuery; | ||||||
| import org.springframework.data.elasticsearch.core.query.NativeSearchQuery; | import org.springframework.data.elasticsearch.core.query.NativeSearchQuery; | ||||||
|  | import org.springframework.data.elasticsearch.entities.ParentEntity; | ||||||
|  | import org.springframework.data.elasticsearch.entities.ParentEntity.ChildEntity; | ||||||
| import org.springframework.test.context.ContextConfiguration; | import org.springframework.test.context.ContextConfiguration; | ||||||
| import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -42,10 +42,10 @@ import org.springframework.data.domain.PageRequest; | |||||||
| import org.springframework.data.domain.Pageable; | import org.springframework.data.domain.Pageable; | ||||||
| import org.springframework.data.domain.Sort; | import org.springframework.data.domain.Sort; | ||||||
| import org.springframework.data.elasticsearch.ElasticsearchException; | import org.springframework.data.elasticsearch.ElasticsearchException; | ||||||
| import org.springframework.data.elasticsearch.SampleEntity; | import org.springframework.data.elasticsearch.builder.SampleEntityBuilder; | ||||||
| import org.springframework.data.elasticsearch.SampleEntityBuilder; |  | ||||||
| import org.springframework.data.elasticsearch.SampleMappingEntity; |  | ||||||
| import org.springframework.data.elasticsearch.core.query.*; | import org.springframework.data.elasticsearch.core.query.*; | ||||||
|  | import org.springframework.data.elasticsearch.entities.SampleEntity; | ||||||
|  | import org.springframework.data.elasticsearch.entities.SampleMappingEntity; | ||||||
| import org.springframework.test.context.ContextConfiguration; | import org.springframework.test.context.ContextConfiguration; | ||||||
| import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | ||||||
| 
 | 
 | ||||||
| @ -75,13 +75,10 @@ public class ElasticsearchTemplateTests { | |||||||
| 	public void shouldReturnCountForGivenSearchQuery() { | 	public void shouldReturnCountForGivenSearchQuery() { | ||||||
| 		// given | 		// given | ||||||
| 		String documentId = randomNumeric(5); | 		String documentId = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity = new SampleEntity(); | 		SampleEntity sampleEntity = new SampleEntityBuilder(documentId).message("some message") | ||||||
| 		sampleEntity.setId(documentId); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity.setMessage("some message"); | 
 | ||||||
| 		sampleEntity.setVersion(System.currentTimeMillis()); | 		IndexQuery indexQuery = getIndexQuery(sampleEntity); | ||||||
| 		IndexQuery indexQuery = new IndexQuery(); |  | ||||||
| 		indexQuery.setId(documentId); |  | ||||||
| 		indexQuery.setObject(sampleEntity); |  | ||||||
| 		elasticsearchTemplate.index(indexQuery); | 		elasticsearchTemplate.index(indexQuery); | ||||||
| 		elasticsearchTemplate.refresh(SampleEntity.class, true); | 		elasticsearchTemplate.refresh(SampleEntity.class, true); | ||||||
| 		SearchQuery searchQuery = new NativeSearchQueryBuilder().withQuery(matchAllQuery()).build(); | 		SearchQuery searchQuery = new NativeSearchQueryBuilder().withQuery(matchAllQuery()).build(); | ||||||
| @ -95,22 +92,16 @@ public class ElasticsearchTemplateTests { | |||||||
| 	public void shouldReturnObjectForGivenId() { | 	public void shouldReturnObjectForGivenId() { | ||||||
| 		// given | 		// given | ||||||
| 		String documentId = randomNumeric(5); | 		String documentId = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity = new SampleEntity(); | 		SampleEntity sampleEntity = new SampleEntityBuilder(documentId).message("some message") | ||||||
| 		sampleEntity.setId(documentId); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity.setMessage("some message"); | 		IndexQuery indexQuery = getIndexQuery(sampleEntity); | ||||||
| 		sampleEntity.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 |  | ||||||
| 		IndexQuery indexQuery = new IndexQuery(); |  | ||||||
| 		indexQuery.setId(documentId); |  | ||||||
| 		indexQuery.setObject(sampleEntity); |  | ||||||
| 
 |  | ||||||
| 		elasticsearchTemplate.index(indexQuery); | 		elasticsearchTemplate.index(indexQuery); | ||||||
| 		// when | 		// when | ||||||
| 		GetQuery getQuery = new GetQuery(); | 		GetQuery getQuery = new GetQuery(); | ||||||
| 		getQuery.setId(documentId); | 		getQuery.setId(documentId); | ||||||
| 		SampleEntity sampleEntity1 = elasticsearchTemplate.queryForObject(getQuery, SampleEntity.class); | 		SampleEntity sampleEntity1 = elasticsearchTemplate.queryForObject(getQuery, SampleEntity.class); | ||||||
| 		// then | 		// then | ||||||
| 		assertNotNull("not null....", sampleEntity1); | 		assertNotNull("entity can't be null....", sampleEntity1); | ||||||
| 		assertEquals(sampleEntity, sampleEntity1); | 		assertEquals(sampleEntity, sampleEntity1); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| @ -120,28 +111,15 @@ public class ElasticsearchTemplateTests { | |||||||
| 		List<IndexQuery> indexQueries = new ArrayList<IndexQuery>(); | 		List<IndexQuery> indexQueries = new ArrayList<IndexQuery>(); | ||||||
| 		// first document | 		// first document | ||||||
| 		String documentId = randomNumeric(5); | 		String documentId = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity1 = new SampleEntity(); | 		SampleEntity sampleEntity1 = new SampleEntityBuilder(documentId).message("some message") | ||||||
| 		sampleEntity1.setId(documentId); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity1.setMessage("some message"); |  | ||||||
| 		sampleEntity1.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 |  | ||||||
| 		IndexQuery indexQuery1 = new IndexQuery(); |  | ||||||
| 		indexQuery1.setId(documentId); |  | ||||||
| 		indexQuery1.setObject(sampleEntity1); |  | ||||||
| 		indexQueries.add(indexQuery1); |  | ||||||
| 
 | 
 | ||||||
| 		// second document | 		// second document | ||||||
| 		String documentId2 = randomNumeric(5); | 		String documentId2 = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity2 = new SampleEntity(); | 		SampleEntity sampleEntity2 = new SampleEntityBuilder(documentId2).message("some message") | ||||||
| 		sampleEntity2.setId(documentId2); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity2.setMessage("some message"); |  | ||||||
| 		sampleEntity2.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 | 
 | ||||||
| 		IndexQuery indexQuery2 = new IndexQuery(); | 		indexQueries = getIndexQueries(Arrays.asList(sampleEntity1, sampleEntity2)); | ||||||
| 		indexQuery2.setId(documentId2); |  | ||||||
| 		indexQuery2.setObject(sampleEntity2); |  | ||||||
| 
 |  | ||||||
| 		indexQueries.add(indexQuery2); |  | ||||||
| 
 | 
 | ||||||
| 		elasticsearchTemplate.bulkIndex(indexQueries); | 		elasticsearchTemplate.bulkIndex(indexQueries); | ||||||
| 		elasticsearchTemplate.refresh(SampleEntity.class, true); | 		elasticsearchTemplate.refresh(SampleEntity.class, true); | ||||||
| @ -161,30 +139,19 @@ public class ElasticsearchTemplateTests { | |||||||
| 		List<IndexQuery> indexQueries = new ArrayList<IndexQuery>(); | 		List<IndexQuery> indexQueries = new ArrayList<IndexQuery>(); | ||||||
| 		// first document | 		// first document | ||||||
| 		String documentId = randomNumeric(5); | 		String documentId = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity1 = new SampleEntity(); | 		SampleEntity sampleEntity1 = new SampleEntityBuilder(documentId) | ||||||
| 		sampleEntity1.setId(documentId); | 				.message("some message") | ||||||
| 		sampleEntity1.setMessage("some message"); | 				.type("type1") | ||||||
| 		sampleEntity1.setType("type1"); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity1.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 |  | ||||||
| 		IndexQuery indexQuery1 = new IndexQuery(); |  | ||||||
| 		indexQuery1.setId(documentId); |  | ||||||
| 		indexQuery1.setObject(sampleEntity1); |  | ||||||
| 		indexQueries.add(indexQuery1); |  | ||||||
| 
 | 
 | ||||||
| 		// second document | 		// second document | ||||||
| 		String documentId2 = randomNumeric(5); | 		String documentId2 = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity2 = new SampleEntity(); | 		SampleEntity sampleEntity2 = new SampleEntityBuilder(documentId2) | ||||||
| 		sampleEntity2.setId(documentId2); | 				.message("some message") | ||||||
| 		sampleEntity2.setMessage("some message"); | 				.type("type2") | ||||||
| 		sampleEntity2.setType("type2"); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity2.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 | 
 | ||||||
| 		IndexQuery indexQuery2 = new IndexQuery(); | 		indexQueries = getIndexQueries(Arrays.asList(sampleEntity1, sampleEntity2)); | ||||||
| 		indexQuery2.setId(documentId2); |  | ||||||
| 		indexQuery2.setObject(sampleEntity2); |  | ||||||
| 
 |  | ||||||
| 		indexQueries.add(indexQuery2); |  | ||||||
| 
 | 
 | ||||||
| 		elasticsearchTemplate.bulkIndex(indexQueries); | 		elasticsearchTemplate.bulkIndex(indexQueries); | ||||||
| 		elasticsearchTemplate.refresh(SampleEntity.class, true); | 		elasticsearchTemplate.refresh(SampleEntity.class, true); | ||||||
| @ -216,14 +183,10 @@ public class ElasticsearchTemplateTests { | |||||||
| 	public void shouldReturnPageForGivenSearchQuery() { | 	public void shouldReturnPageForGivenSearchQuery() { | ||||||
| 		// given | 		// given | ||||||
| 		String documentId = randomNumeric(5); | 		String documentId = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity = new SampleEntity(); | 		SampleEntity sampleEntity = new SampleEntityBuilder(documentId).message("some message") | ||||||
| 		sampleEntity.setId(documentId); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity.setMessage("some message"); |  | ||||||
| 		sampleEntity.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 | 
 | ||||||
| 		IndexQuery indexQuery = new IndexQuery(); | 		IndexQuery indexQuery = getIndexQuery(sampleEntity); | ||||||
| 		indexQuery.setId(documentId); |  | ||||||
| 		indexQuery.setObject(sampleEntity); |  | ||||||
| 
 | 
 | ||||||
| 		elasticsearchTemplate.index(indexQuery); | 		elasticsearchTemplate.index(indexQuery); | ||||||
| 		elasticsearchTemplate.refresh(SampleEntity.class, true); | 		elasticsearchTemplate.refresh(SampleEntity.class, true); | ||||||
| @ -242,28 +205,16 @@ public class ElasticsearchTemplateTests { | |||||||
| 		List<IndexQuery> indexQueries = new ArrayList<IndexQuery>(); | 		List<IndexQuery> indexQueries = new ArrayList<IndexQuery>(); | ||||||
| 		// first document | 		// first document | ||||||
| 		String documentId = randomNumeric(5); | 		String documentId = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity1 = new SampleEntity(); | 		SampleEntity sampleEntity1 = new SampleEntityBuilder(documentId).message("some message") | ||||||
| 		sampleEntity1.setId(documentId); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity1.setMessage("some message"); |  | ||||||
| 		sampleEntity1.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 |  | ||||||
| 		IndexQuery indexQuery1 = new IndexQuery(); |  | ||||||
| 		indexQuery1.setId(documentId); |  | ||||||
| 		indexQuery1.setObject(sampleEntity1); |  | ||||||
| 		indexQueries.add(indexQuery1); |  | ||||||
| 
 | 
 | ||||||
| 		// second document | 		// second document | ||||||
| 		String documentId2 = randomNumeric(5); | 		String documentId2 = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity2 = new SampleEntity(); | 		SampleEntity sampleEntity2 = new SampleEntityBuilder(documentId2).message("some message") | ||||||
| 		sampleEntity2.setId(documentId2); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity2.setMessage("some message"); |  | ||||||
| 		sampleEntity2.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 | 
 | ||||||
| 		IndexQuery indexQuery2 = new IndexQuery(); | 		indexQueries = getIndexQueries(Arrays.asList(sampleEntity1, sampleEntity2)); | ||||||
| 		indexQuery2.setId(documentId2); |  | ||||||
| 		indexQuery2.setObject(sampleEntity2); |  | ||||||
| 
 | 
 | ||||||
| 		indexQueries.add(indexQuery2); |  | ||||||
| 		// when | 		// when | ||||||
| 		elasticsearchTemplate.bulkIndex(indexQueries); | 		elasticsearchTemplate.bulkIndex(indexQueries); | ||||||
| 		elasticsearchTemplate.refresh(SampleEntity.class, true); | 		elasticsearchTemplate.refresh(SampleEntity.class, true); | ||||||
| @ -277,14 +228,10 @@ public class ElasticsearchTemplateTests { | |||||||
| 	public void shouldDeleteDocumentForGivenId() { | 	public void shouldDeleteDocumentForGivenId() { | ||||||
| 		// given | 		// given | ||||||
| 		String documentId = randomNumeric(5); | 		String documentId = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity = new SampleEntity(); | 		SampleEntity sampleEntity = new SampleEntityBuilder(documentId).message("some message") | ||||||
| 		sampleEntity.setId(documentId); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity.setMessage("some message"); |  | ||||||
| 		sampleEntity.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 | 
 | ||||||
| 		IndexQuery indexQuery = new IndexQuery(); | 		IndexQuery indexQuery = getIndexQuery(sampleEntity); | ||||||
| 		indexQuery.setId(documentId); |  | ||||||
| 		indexQuery.setObject(sampleEntity); |  | ||||||
| 
 | 
 | ||||||
| 		elasticsearchTemplate.index(indexQuery); | 		elasticsearchTemplate.index(indexQuery); | ||||||
| 		// when | 		// when | ||||||
| @ -300,14 +247,10 @@ public class ElasticsearchTemplateTests { | |||||||
| 	public void shouldDeleteEntityForGivenId() { | 	public void shouldDeleteEntityForGivenId() { | ||||||
| 		// given | 		// given | ||||||
| 		String documentId = randomNumeric(5); | 		String documentId = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity = new SampleEntity(); | 		SampleEntity sampleEntity = new SampleEntityBuilder(documentId).message("some message") | ||||||
| 		sampleEntity.setId(documentId); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity.setMessage("some message"); |  | ||||||
| 		sampleEntity.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 | 
 | ||||||
| 		IndexQuery indexQuery = new IndexQuery(); | 		IndexQuery indexQuery = getIndexQuery(sampleEntity); | ||||||
| 		indexQuery.setId(documentId); |  | ||||||
| 		indexQuery.setObject(sampleEntity); |  | ||||||
| 
 | 
 | ||||||
| 		elasticsearchTemplate.index(indexQuery); | 		elasticsearchTemplate.index(indexQuery); | ||||||
| 		// when | 		// when | ||||||
| @ -323,14 +266,10 @@ public class ElasticsearchTemplateTests { | |||||||
| 	public void shouldDeleteDocumentForGivenQuery() { | 	public void shouldDeleteDocumentForGivenQuery() { | ||||||
| 		// given | 		// given | ||||||
| 		String documentId = randomNumeric(5); | 		String documentId = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity = new SampleEntity(); | 		SampleEntity sampleEntity = new SampleEntityBuilder(documentId).message("some message") | ||||||
| 		sampleEntity.setId(documentId); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity.setMessage("some message"); |  | ||||||
| 		sampleEntity.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 | 
 | ||||||
| 		IndexQuery indexQuery = new IndexQuery(); | 		IndexQuery indexQuery = getIndexQuery(sampleEntity); | ||||||
| 		indexQuery.setId(documentId); |  | ||||||
| 		indexQuery.setObject(sampleEntity); |  | ||||||
| 
 | 
 | ||||||
| 		elasticsearchTemplate.index(indexQuery); | 		elasticsearchTemplate.index(indexQuery); | ||||||
| 		// when | 		// when | ||||||
| @ -347,14 +286,10 @@ public class ElasticsearchTemplateTests { | |||||||
| 	public void shouldFilterSearchResultsForGivenFilter() { | 	public void shouldFilterSearchResultsForGivenFilter() { | ||||||
| 		// given | 		// given | ||||||
| 		String documentId = randomNumeric(5); | 		String documentId = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity = new SampleEntity(); | 		SampleEntity sampleEntity = new SampleEntityBuilder(documentId).message("some message") | ||||||
| 		sampleEntity.setId(documentId); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity.setMessage("some message"); |  | ||||||
| 		sampleEntity.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 | 
 | ||||||
| 		IndexQuery indexQuery = new IndexQuery(); | 		IndexQuery indexQuery = getIndexQuery(sampleEntity); | ||||||
| 		indexQuery.setId(documentId); |  | ||||||
| 		indexQuery.setObject(sampleEntity); |  | ||||||
| 		elasticsearchTemplate.index(indexQuery); | 		elasticsearchTemplate.index(indexQuery); | ||||||
| 		elasticsearchTemplate.refresh(SampleEntity.class, true); | 		elasticsearchTemplate.refresh(SampleEntity.class, true); | ||||||
| 
 | 
 | ||||||
| @ -372,43 +307,26 @@ public class ElasticsearchTemplateTests { | |||||||
| 		List<IndexQuery> indexQueries = new ArrayList<IndexQuery>(); | 		List<IndexQuery> indexQueries = new ArrayList<IndexQuery>(); | ||||||
| 		// first document | 		// first document | ||||||
| 		String documentId = randomNumeric(5); | 		String documentId = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity1 = new SampleEntity(); | 		SampleEntity sampleEntity1 = new SampleEntityBuilder(documentId) | ||||||
| 		sampleEntity1.setId(documentId); | 				.message("abc") | ||||||
| 		sampleEntity1.setMessage("abc"); | 				.rate(10) | ||||||
| 		sampleEntity1.setRate(10); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity1.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 |  | ||||||
| 		IndexQuery indexQuery1 = new IndexQuery(); |  | ||||||
| 		indexQuery1.setId(documentId); |  | ||||||
| 		indexQuery1.setObject(sampleEntity1); |  | ||||||
| 
 | 
 | ||||||
| 		// second document | 		// second document | ||||||
| 		String documentId2 = randomNumeric(5); | 		String documentId2 = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity2 = new SampleEntity(); | 		SampleEntity sampleEntity2 = new SampleEntityBuilder(documentId2) | ||||||
| 		sampleEntity2.setId(documentId2); | 				.message("xyz") | ||||||
| 		sampleEntity2.setMessage("xyz"); | 				.rate(5) | ||||||
| 		sampleEntity2.setRate(5); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity2.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 |  | ||||||
| 		IndexQuery indexQuery2 = new IndexQuery(); |  | ||||||
| 		indexQuery2.setId(documentId2); |  | ||||||
| 		indexQuery2.setObject(sampleEntity2); |  | ||||||
| 
 | 
 | ||||||
| 		// third document | 		// third document | ||||||
| 		String documentId3 = randomNumeric(5); | 		String documentId3 = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity3 = new SampleEntity(); | 		SampleEntity sampleEntity3 = new SampleEntityBuilder(documentId3) | ||||||
| 		sampleEntity3.setId(documentId3); | 				.message("xyz") | ||||||
| 		sampleEntity3.setMessage("xyz"); | 				.rate(15) | ||||||
| 		sampleEntity3.setRate(15); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity3.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 | 
 | ||||||
| 		IndexQuery indexQuery3 = new IndexQuery(); | 		indexQueries = getIndexQueries(Arrays.asList(sampleEntity1, sampleEntity2, sampleEntity3)); | ||||||
| 		indexQuery3.setId(documentId3); |  | ||||||
| 		indexQuery3.setObject(sampleEntity3); |  | ||||||
| 
 |  | ||||||
| 		indexQueries.add(indexQuery1); |  | ||||||
| 		indexQueries.add(indexQuery2); |  | ||||||
| 		indexQueries.add(indexQuery3); |  | ||||||
| 
 | 
 | ||||||
| 		elasticsearchTemplate.bulkIndex(indexQueries); | 		elasticsearchTemplate.bulkIndex(indexQueries); | ||||||
| 		elasticsearchTemplate.refresh(SampleEntity.class, true); | 		elasticsearchTemplate.refresh(SampleEntity.class, true); | ||||||
| @ -428,43 +346,26 @@ public class ElasticsearchTemplateTests { | |||||||
| 		List<IndexQuery> indexQueries = new ArrayList<IndexQuery>(); | 		List<IndexQuery> indexQueries = new ArrayList<IndexQuery>(); | ||||||
| 		// first document | 		// first document | ||||||
| 		String documentId = randomNumeric(5); | 		String documentId = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity1 = new SampleEntity(); | 		SampleEntity sampleEntity1 = new SampleEntityBuilder(documentId) | ||||||
| 		sampleEntity1.setId(documentId); | 				.message("abc") | ||||||
| 		sampleEntity1.setMessage("abc"); | 				.rate(10) | ||||||
| 		sampleEntity1.setRate(15); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity1.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 |  | ||||||
| 		IndexQuery indexQuery1 = new IndexQuery(); |  | ||||||
| 		indexQuery1.setId(documentId); |  | ||||||
| 		indexQuery1.setObject(sampleEntity1); |  | ||||||
| 
 | 
 | ||||||
| 		// second document | 		// second document | ||||||
| 		String documentId2 = randomNumeric(5); | 		String documentId2 = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity2 = new SampleEntity(); | 		SampleEntity sampleEntity2 = new SampleEntityBuilder(documentId2) | ||||||
| 		sampleEntity2.setId(documentId2); | 				.message("xyz") | ||||||
| 		sampleEntity2.setMessage("xyz"); | 				.rate(5) | ||||||
| 		sampleEntity2.setRate(5); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity2.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 |  | ||||||
| 		IndexQuery indexQuery2 = new IndexQuery(); |  | ||||||
| 		indexQuery2.setId(documentId2); |  | ||||||
| 		indexQuery2.setObject(sampleEntity2); |  | ||||||
| 
 | 
 | ||||||
| 		// third document | 		// third document | ||||||
| 		String documentId3 = randomNumeric(5); | 		String documentId3 = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity3 = new SampleEntity(); | 		SampleEntity sampleEntity3 = new SampleEntityBuilder(documentId3) | ||||||
| 		sampleEntity3.setId(documentId3); | 				.message("xyz") | ||||||
| 		sampleEntity3.setMessage("xyz"); | 				.rate(15) | ||||||
| 		sampleEntity3.setRate(15); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity3.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 | 
 | ||||||
| 		IndexQuery indexQuery3 = new IndexQuery(); | 		indexQueries = getIndexQueries(Arrays.asList(sampleEntity1, sampleEntity2, sampleEntity3)); | ||||||
| 		indexQuery3.setId(documentId3); |  | ||||||
| 		indexQuery3.setObject(sampleEntity3); |  | ||||||
| 
 |  | ||||||
| 		indexQueries.add(indexQuery1); |  | ||||||
| 		indexQueries.add(indexQuery2); |  | ||||||
| 		indexQueries.add(indexQuery3); |  | ||||||
| 
 | 
 | ||||||
| 		elasticsearchTemplate.bulkIndex(indexQueries); | 		elasticsearchTemplate.bulkIndex(indexQueries); | ||||||
| 		elasticsearchTemplate.refresh(SampleEntity.class, true); | 		elasticsearchTemplate.refresh(SampleEntity.class, true); | ||||||
| @ -484,14 +385,10 @@ public class ElasticsearchTemplateTests { | |||||||
| 	public void shouldExecuteStringQuery() { | 	public void shouldExecuteStringQuery() { | ||||||
| 		// given | 		// given | ||||||
| 		String documentId = randomNumeric(5); | 		String documentId = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity = new SampleEntity(); | 		SampleEntity sampleEntity = new SampleEntityBuilder(documentId).message("some message") | ||||||
| 		sampleEntity.setId(documentId); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity.setMessage("some message"); |  | ||||||
| 		sampleEntity.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 | 
 | ||||||
| 		IndexQuery indexQuery = new IndexQuery(); | 		IndexQuery indexQuery = getIndexQuery(sampleEntity); | ||||||
| 		indexQuery.setId(documentId); |  | ||||||
| 		indexQuery.setObject(sampleEntity); |  | ||||||
| 
 | 
 | ||||||
| 		elasticsearchTemplate.index(indexQuery); | 		elasticsearchTemplate.index(indexQuery); | ||||||
| 		elasticsearchTemplate.refresh(SampleEntity.class, true); | 		elasticsearchTemplate.refresh(SampleEntity.class, true); | ||||||
| @ -507,14 +404,10 @@ public class ElasticsearchTemplateTests { | |||||||
| 	public void shouldReturnPageableResultsGivenStringQuery() { | 	public void shouldReturnPageableResultsGivenStringQuery() { | ||||||
| 		// given | 		// given | ||||||
| 		String documentId = randomNumeric(5); | 		String documentId = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity = new SampleEntity(); | 		SampleEntity sampleEntity = new SampleEntityBuilder(documentId).message("some message") | ||||||
| 		sampleEntity.setId(documentId); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity.setMessage("some message"); |  | ||||||
| 		sampleEntity.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 | 
 | ||||||
| 		IndexQuery indexQuery = new IndexQuery(); | 		IndexQuery indexQuery = getIndexQuery(sampleEntity); | ||||||
| 		indexQuery.setId(documentId); |  | ||||||
| 		indexQuery.setObject(sampleEntity); |  | ||||||
| 
 | 
 | ||||||
| 		elasticsearchTemplate.index(indexQuery); | 		elasticsearchTemplate.index(indexQuery); | ||||||
| 		elasticsearchTemplate.refresh(SampleEntity.class, true); | 		elasticsearchTemplate.refresh(SampleEntity.class, true); | ||||||
| @ -557,14 +450,10 @@ public class ElasticsearchTemplateTests { | |||||||
| 	public void shouldReturnObjectMatchingGivenStringQuery() { | 	public void shouldReturnObjectMatchingGivenStringQuery() { | ||||||
| 		// given | 		// given | ||||||
| 		String documentId = randomNumeric(5); | 		String documentId = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity = new SampleEntity(); | 		SampleEntity sampleEntity = new SampleEntityBuilder(documentId).message("some message") | ||||||
| 		sampleEntity.setId(documentId); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity.setMessage("some message"); |  | ||||||
| 		sampleEntity.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 | 
 | ||||||
| 		IndexQuery indexQuery = new IndexQuery(); | 		IndexQuery indexQuery = getIndexQuery(sampleEntity); | ||||||
| 		indexQuery.setId(documentId); |  | ||||||
| 		indexQuery.setObject(sampleEntity); |  | ||||||
| 
 | 
 | ||||||
| 		elasticsearchTemplate.index(indexQuery); | 		elasticsearchTemplate.index(indexQuery); | ||||||
| 		elasticsearchTemplate.refresh(SampleEntity.class, true); | 		elasticsearchTemplate.refresh(SampleEntity.class, true); | ||||||
| @ -589,14 +478,10 @@ public class ElasticsearchTemplateTests { | |||||||
| 	public void shouldExecuteGivenCriteriaQuery() { | 	public void shouldExecuteGivenCriteriaQuery() { | ||||||
| 		// given | 		// given | ||||||
| 		String documentId = randomNumeric(5); | 		String documentId = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity = new SampleEntity(); | 		SampleEntity sampleEntity = new SampleEntityBuilder(documentId).message("test message") | ||||||
| 		sampleEntity.setId(documentId); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity.setMessage("some test message"); |  | ||||||
| 		sampleEntity.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 | 
 | ||||||
| 		IndexQuery indexQuery = new IndexQuery(); | 		IndexQuery indexQuery = getIndexQuery(sampleEntity); | ||||||
| 		indexQuery.setId(documentId); |  | ||||||
| 		indexQuery.setObject(sampleEntity); |  | ||||||
| 
 | 
 | ||||||
| 		elasticsearchTemplate.index(indexQuery); | 		elasticsearchTemplate.index(indexQuery); | ||||||
| 		elasticsearchTemplate.refresh(SampleEntity.class, true); | 		elasticsearchTemplate.refresh(SampleEntity.class, true); | ||||||
| @ -613,14 +498,10 @@ public class ElasticsearchTemplateTests { | |||||||
| 		// given | 		// given | ||||||
| 		String documentId = randomNumeric(5); | 		String documentId = randomNumeric(5); | ||||||
| 		String message = "some test message"; | 		String message = "some test message"; | ||||||
| 		SampleEntity sampleEntity = new SampleEntity(); | 		SampleEntity sampleEntity = new SampleEntityBuilder(documentId).message(message) | ||||||
| 		sampleEntity.setId(documentId); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity.setMessage(message); |  | ||||||
| 		sampleEntity.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 | 
 | ||||||
| 		IndexQuery indexQuery = new IndexQuery(); | 		IndexQuery indexQuery = getIndexQuery(sampleEntity); | ||||||
| 		indexQuery.setId(documentId); |  | ||||||
| 		indexQuery.setObject(sampleEntity); |  | ||||||
| 
 | 
 | ||||||
| 		elasticsearchTemplate.index(indexQuery); | 		elasticsearchTemplate.index(indexQuery); | ||||||
| 		elasticsearchTemplate.refresh(SampleEntity.class, true); | 		elasticsearchTemplate.refresh(SampleEntity.class, true); | ||||||
| @ -653,28 +534,17 @@ public class ElasticsearchTemplateTests { | |||||||
| 				+ "we want real-time search, we want simple multi-tenancy, and we want a solution that is built for the cloud."; | 				+ "we want real-time search, we want simple multi-tenancy, and we want a solution that is built for the cloud."; | ||||||
| 
 | 
 | ||||||
| 		String documentId1 = randomNumeric(5); | 		String documentId1 = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity1 = new SampleEntity(); | 		SampleEntity sampleEntity = new SampleEntityBuilder(documentId1).message(sampleMessage) | ||||||
| 		sampleEntity1.setId(documentId1); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity1.setMessage(sampleMessage); |  | ||||||
| 		sampleEntity1.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 | 
 | ||||||
| 		IndexQuery indexQuery1 = new IndexQuery(); | 		IndexQuery indexQuery = getIndexQuery(sampleEntity); | ||||||
| 		indexQuery1.setId(documentId1); |  | ||||||
| 		indexQuery1.setObject(sampleEntity1); |  | ||||||
| 
 | 
 | ||||||
| 		elasticsearchTemplate.index(indexQuery1); | 		elasticsearchTemplate.index(indexQuery); | ||||||
| 
 | 
 | ||||||
| 		String documentId2 = randomNumeric(5); | 		String documentId2 = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity2 = new SampleEntity(); |  | ||||||
| 		sampleEntity2.setId(documentId2); |  | ||||||
| 		sampleEntity2.setMessage(sampleMessage); |  | ||||||
| 		sampleEntity2.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 | 
 | ||||||
| 		IndexQuery indexQuery2 = new IndexQuery(); | 		elasticsearchTemplate.index(getIndexQuery(new SampleEntityBuilder(documentId2).message(sampleMessage) | ||||||
| 		indexQuery2.setId(documentId2); | 				.version(System.currentTimeMillis()).build())); | ||||||
| 		indexQuery2.setObject(sampleEntity2); |  | ||||||
| 
 |  | ||||||
| 		elasticsearchTemplate.index(indexQuery2); |  | ||||||
| 		elasticsearchTemplate.refresh(SampleEntity.class, true); | 		elasticsearchTemplate.refresh(SampleEntity.class, true); | ||||||
| 
 | 
 | ||||||
| 		MoreLikeThisQuery moreLikeThisQuery = new MoreLikeThisQuery(); | 		MoreLikeThisQuery moreLikeThisQuery = new MoreLikeThisQuery(); | ||||||
| @ -686,7 +556,7 @@ public class ElasticsearchTemplateTests { | |||||||
| 
 | 
 | ||||||
| 		// then | 		// then | ||||||
| 		assertThat(sampleEntities.getTotalElements(), is(equalTo(1L))); | 		assertThat(sampleEntities.getTotalElements(), is(equalTo(1L))); | ||||||
| 		assertThat(sampleEntities.getContent(), hasItem(sampleEntity1)); | 		assertThat(sampleEntities.getContent(), hasItem(sampleEntity)); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	@Test | 	@Test | ||||||
| @ -782,41 +652,26 @@ public class ElasticsearchTemplateTests { | |||||||
| 		List<IndexQuery> indexQueries = new ArrayList<IndexQuery>(); | 		List<IndexQuery> indexQueries = new ArrayList<IndexQuery>(); | ||||||
| 		// first document | 		// first document | ||||||
| 		String documentId = randomNumeric(5); | 		String documentId = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity1 = new SampleEntity(); | 		SampleEntity sampleEntity1 = new SampleEntityBuilder(documentId) | ||||||
| 		sampleEntity1.setId(documentId); | 				.message("test message") | ||||||
| 		sampleEntity1.setMessage("test message"); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity1.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 |  | ||||||
| 		IndexQuery indexQuery1 = new IndexQuery(); |  | ||||||
| 		indexQuery1.setId(documentId); |  | ||||||
| 		indexQuery1.setObject(sampleEntity1); |  | ||||||
| 		indexQueries.add(indexQuery1); |  | ||||||
| 
 | 
 | ||||||
| 		// second document | 		// second document | ||||||
| 		String documentId2 = randomNumeric(5); | 		String documentId2 = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity2 = new SampleEntity(); | 		SampleEntity sampleEntity2 = new SampleEntityBuilder(documentId2) | ||||||
| 		sampleEntity2.setId(documentId2); | 				.message("test test") | ||||||
| 		sampleEntity2.setMessage("test test"); | 				.rate(5) | ||||||
| 		sampleEntity2.setVersion(System.currentTimeMillis()); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 
 | 
 | ||||||
| 		IndexQuery indexQuery2 = new IndexQuery(); | 		// third document | ||||||
| 		indexQuery2.setId(documentId2); |  | ||||||
| 		indexQuery2.setObject(sampleEntity2); |  | ||||||
| 
 |  | ||||||
| 		indexQueries.add(indexQuery2); |  | ||||||
| 
 |  | ||||||
| 		// second document |  | ||||||
| 		String documentId3 = randomNumeric(5); | 		String documentId3 = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity3 = new SampleEntity(); | 		SampleEntity sampleEntity3 = new SampleEntityBuilder(documentId3) | ||||||
| 		sampleEntity3.setId(documentId3); | 				.message("some message") | ||||||
| 		sampleEntity3.setMessage("some message"); | 				.rate(15) | ||||||
| 		sampleEntity3.setVersion(System.currentTimeMillis()); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 
 | 
 | ||||||
| 		IndexQuery indexQuery3 = new IndexQuery(); | 		indexQueries = getIndexQueries(Arrays.asList(sampleEntity1, sampleEntity2, sampleEntity3)); | ||||||
| 		indexQuery3.setId(documentId3); |  | ||||||
| 		indexQuery3.setObject(sampleEntity3); |  | ||||||
| 
 | 
 | ||||||
| 		indexQueries.add(indexQuery3); |  | ||||||
| 		// when | 		// when | ||||||
| 		elasticsearchTemplate.bulkIndex(indexQueries); | 		elasticsearchTemplate.bulkIndex(indexQueries); | ||||||
| 		elasticsearchTemplate.refresh(SampleEntity.class, true); | 		elasticsearchTemplate.refresh(SampleEntity.class, true); | ||||||
| @ -839,41 +694,26 @@ public class ElasticsearchTemplateTests { | |||||||
| 		List<IndexQuery> indexQueries = new ArrayList<IndexQuery>(); | 		List<IndexQuery> indexQueries = new ArrayList<IndexQuery>(); | ||||||
| 		// first document | 		// first document | ||||||
| 		String documentId = randomNumeric(5); | 		String documentId = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity1 = new SampleEntity(); | 		SampleEntity sampleEntity1 = new SampleEntityBuilder(documentId) | ||||||
| 		sampleEntity1.setId(documentId); | 				.message("test message") | ||||||
| 		sampleEntity1.setMessage("test message"); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity1.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 |  | ||||||
| 		IndexQuery indexQuery1 = new IndexQuery(); |  | ||||||
| 		indexQuery1.setId(documentId); |  | ||||||
| 		indexQuery1.setObject(sampleEntity1); |  | ||||||
| 		indexQueries.add(indexQuery1); |  | ||||||
| 
 | 
 | ||||||
| 		// second document | 		// second document | ||||||
| 		String documentId2 = randomNumeric(5); | 		String documentId2 = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity2 = new SampleEntity(); | 		SampleEntity sampleEntity2 = new SampleEntityBuilder(documentId2) | ||||||
| 		sampleEntity2.setId(documentId2); | 				.message("test test") | ||||||
| 		sampleEntity2.setMessage("test test"); | 				.rate(5) | ||||||
| 		sampleEntity2.setVersion(System.currentTimeMillis()); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 
 | 
 | ||||||
| 		IndexQuery indexQuery2 = new IndexQuery(); | 		// third document | ||||||
| 		indexQuery2.setId(documentId2); |  | ||||||
| 		indexQuery2.setObject(sampleEntity2); |  | ||||||
| 
 |  | ||||||
| 		indexQueries.add(indexQuery2); |  | ||||||
| 
 |  | ||||||
| 		// second document |  | ||||||
| 		String documentId3 = randomNumeric(5); | 		String documentId3 = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity3 = new SampleEntity(); | 		SampleEntity sampleEntity3 = new SampleEntityBuilder(documentId3) | ||||||
| 		sampleEntity3.setId(documentId3); | 				.message("some message") | ||||||
| 		sampleEntity3.setMessage("some message"); | 				.rate(15) | ||||||
| 		sampleEntity3.setVersion(System.currentTimeMillis()); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 
 | 
 | ||||||
| 		IndexQuery indexQuery3 = new IndexQuery(); | 		indexQueries = getIndexQueries(Arrays.asList(sampleEntity1, sampleEntity2, sampleEntity3)); | ||||||
| 		indexQuery3.setId(documentId3); |  | ||||||
| 		indexQuery3.setObject(sampleEntity3); |  | ||||||
| 
 | 
 | ||||||
| 		indexQueries.add(indexQuery3); |  | ||||||
| 		// when | 		// when | ||||||
| 		elasticsearchTemplate.bulkIndex(indexQueries); | 		elasticsearchTemplate.bulkIndex(indexQueries); | ||||||
| 		elasticsearchTemplate.refresh(SampleEntity.class, true); | 		elasticsearchTemplate.refresh(SampleEntity.class, true); | ||||||
| @ -910,14 +750,11 @@ public class ElasticsearchTemplateTests { | |||||||
| 		String messageBeforeUpdate = "some test message"; | 		String messageBeforeUpdate = "some test message"; | ||||||
| 		String messageAfterUpdate = "test message"; | 		String messageAfterUpdate = "test message"; | ||||||
| 
 | 
 | ||||||
| 		SampleEntity sampleEntity = new SampleEntity(); | 		SampleEntity sampleEntity = new SampleEntityBuilder(documentId) | ||||||
| 		sampleEntity.setId(documentId); | 				.message(messageBeforeUpdate) | ||||||
| 		sampleEntity.setMessage(messageBeforeUpdate); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 | 
 | ||||||
| 		IndexQuery indexQuery = new IndexQuery(); | 		IndexQuery indexQuery = getIndexQuery(sampleEntity); | ||||||
| 		indexQuery.setId(documentId); |  | ||||||
| 		indexQuery.setObject(sampleEntity); |  | ||||||
| 
 | 
 | ||||||
| 		elasticsearchTemplate.index(indexQuery); | 		elasticsearchTemplate.index(indexQuery); | ||||||
| 		elasticsearchTemplate.refresh(SampleEntity.class, true); | 		elasticsearchTemplate.refresh(SampleEntity.class, true); | ||||||
| @ -971,14 +808,11 @@ public class ElasticsearchTemplateTests { | |||||||
| 		String actualMessage = "some test message"; | 		String actualMessage = "some test message"; | ||||||
| 		String highlightedMessage = "some <em>test</em> message"; | 		String highlightedMessage = "some <em>test</em> message"; | ||||||
| 
 | 
 | ||||||
| 		SampleEntity sampleEntity = new SampleEntity(); | 		SampleEntity sampleEntity = new SampleEntityBuilder(documentId) | ||||||
| 		sampleEntity.setId(documentId); | 				.message(actualMessage) | ||||||
| 		sampleEntity.setMessage(actualMessage); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 | 
 | ||||||
| 		IndexQuery indexQuery = new IndexQuery(); | 		IndexQuery indexQuery = getIndexQuery(sampleEntity); | ||||||
| 		indexQuery.setId(documentId); |  | ||||||
| 		indexQuery.setObject(sampleEntity); |  | ||||||
| 
 | 
 | ||||||
| 		elasticsearchTemplate.index(indexQuery); | 		elasticsearchTemplate.index(indexQuery); | ||||||
| 		elasticsearchTemplate.refresh(SampleEntity.class, true); | 		elasticsearchTemplate.refresh(SampleEntity.class, true); | ||||||
| @ -1016,14 +850,11 @@ public class ElasticsearchTemplateTests { | |||||||
| 	public void shouldDeleteSpecifiedTypeFromAnIndex() { | 	public void shouldDeleteSpecifiedTypeFromAnIndex() { | ||||||
| 		// given | 		// given | ||||||
| 		String documentId = randomNumeric(5); | 		String documentId = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity = new SampleEntity(); | 		SampleEntity sampleEntity = new SampleEntityBuilder(documentId) | ||||||
| 		sampleEntity.setId(documentId); | 				.message("some message") | ||||||
| 		sampleEntity.setMessage("some message"); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 | 
 | ||||||
| 		IndexQuery indexQuery = new IndexQuery(); | 		IndexQuery indexQuery = getIndexQuery(sampleEntity); | ||||||
| 		indexQuery.setId(documentId); |  | ||||||
| 		indexQuery.setObject(sampleEntity); |  | ||||||
| 
 | 
 | ||||||
| 		elasticsearchTemplate.index(indexQuery); | 		elasticsearchTemplate.index(indexQuery); | ||||||
| 		elasticsearchTemplate.refresh(SampleEntity.class, true); | 		elasticsearchTemplate.refresh(SampleEntity.class, true); | ||||||
| @ -1039,14 +870,11 @@ public class ElasticsearchTemplateTests { | |||||||
| 	public void shouldDeleteDocumentBySpecifiedTypeUsingDeleteQuery() { | 	public void shouldDeleteDocumentBySpecifiedTypeUsingDeleteQuery() { | ||||||
| 		// given | 		// given | ||||||
| 		String documentId = randomNumeric(5); | 		String documentId = randomNumeric(5); | ||||||
| 		SampleEntity sampleEntity = new SampleEntity(); | 		SampleEntity sampleEntity = new SampleEntityBuilder(documentId) | ||||||
| 		sampleEntity.setId(documentId); | 				.message("some message") | ||||||
| 		sampleEntity.setMessage("some message"); | 				.version(System.currentTimeMillis()).build(); | ||||||
| 		sampleEntity.setVersion(System.currentTimeMillis()); |  | ||||||
| 
 | 
 | ||||||
| 		IndexQuery indexQuery = new IndexQuery(); | 		IndexQuery indexQuery = getIndexQuery(sampleEntity); | ||||||
| 		indexQuery.setId(documentId); |  | ||||||
| 		indexQuery.setObject(sampleEntity); |  | ||||||
| 
 | 
 | ||||||
| 		elasticsearchTemplate.index(indexQuery); | 		elasticsearchTemplate.index(indexQuery); | ||||||
| 		elasticsearchTemplate.refresh(SampleEntity.class, true); | 		elasticsearchTemplate.refresh(SampleEntity.class, true); | ||||||
| @ -1341,4 +1169,19 @@ public class ElasticsearchTemplateTests { | |||||||
| 		assertThat(sampleEntities, is(notNullValue())); | 		assertThat(sampleEntities, is(notNullValue())); | ||||||
| 		assertThat(sampleEntities.getTotalElements(), greaterThanOrEqualTo(1L)); | 		assertThat(sampleEntities.getTotalElements(), greaterThanOrEqualTo(1L)); | ||||||
| 	} | 	} | ||||||
|  | 
 | ||||||
|  | 	private IndexQuery getIndexQuery(SampleEntity sampleEntity) { | ||||||
|  | 		IndexQuery indexQuery = new IndexQuery(); | ||||||
|  | 		indexQuery.setId(sampleEntity.getId()); | ||||||
|  | 		indexQuery.setObject(sampleEntity); | ||||||
|  | 		return indexQuery; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	private List<IndexQuery> getIndexQueries(List<SampleEntity> sampleEntities) { | ||||||
|  | 		List<IndexQuery> indexQueries = new ArrayList<IndexQuery>(); | ||||||
|  | 		for (SampleEntity sampleEntity : sampleEntities) { | ||||||
|  | 			indexQueries.add(new IndexQueryBuilder().withId(sampleEntity.getId()).withObject(sampleEntity).build()); | ||||||
|  | 		} | ||||||
|  | 		return indexQueries; | ||||||
|  | 	} | ||||||
| } | } | ||||||
|  | |||||||
| @ -28,9 +28,13 @@ import org.elasticsearch.common.xcontent.XContentBuilder; | |||||||
| import org.junit.Test; | import org.junit.Test; | ||||||
| import org.junit.runner.RunWith; | import org.junit.runner.RunWith; | ||||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||||
| import org.springframework.data.elasticsearch.*; | import org.springframework.data.elasticsearch.builder.StockPriceBuilder; | ||||||
| import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder; | import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder; | ||||||
| import org.springframework.data.elasticsearch.core.query.SearchQuery; | import org.springframework.data.elasticsearch.core.query.SearchQuery; | ||||||
|  | import org.springframework.data.elasticsearch.entities.MinimalEntity; | ||||||
|  | import org.springframework.data.elasticsearch.entities.SampleTransientEntity; | ||||||
|  | import org.springframework.data.elasticsearch.entities.SimpleRecursiveEntity; | ||||||
|  | import org.springframework.data.elasticsearch.entities.StockPrice; | ||||||
| import org.springframework.test.context.ContextConfiguration; | import org.springframework.test.context.ContextConfiguration; | ||||||
| import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -21,7 +21,7 @@ import java.io.IOException; | |||||||
| import org.elasticsearch.common.xcontent.XContentBuilder; | import org.elasticsearch.common.xcontent.XContentBuilder; | ||||||
| import org.junit.Assert; | import org.junit.Assert; | ||||||
| import org.junit.Test; | import org.junit.Test; | ||||||
| import org.springframework.data.elasticsearch.SampleDateMappingEntity; | import org.springframework.data.elasticsearch.entities.SampleDateMappingEntity; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * @author Jakub Vavrik |  * @author Jakub Vavrik | ||||||
|  | |||||||
| @ -1,3 +1,18 @@ | |||||||
|  | /* | ||||||
|  |  * Copyright 2014 the original author or authors. | ||||||
|  |  * | ||||||
|  |  * Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
|  |  * you may not use this file except in compliance with the License. | ||||||
|  |  * You may obtain a copy of the License at | ||||||
|  |  * | ||||||
|  |  *      http://www.apache.org/licenses/LICENSE-2.0 | ||||||
|  |  * | ||||||
|  |  * Unless required by applicable law or agreed to in writing, software | ||||||
|  |  * distributed under the License is distributed on an "AS IS" BASIS, | ||||||
|  |  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||
|  |  * See the License for the specific language governing permissions and | ||||||
|  |  * limitations under the License. | ||||||
|  |  */ | ||||||
| package org.springframework.data.elasticsearch.core.facet; | package org.springframework.data.elasticsearch.core.facet; | ||||||
| 
 | 
 | ||||||
| import static org.springframework.data.elasticsearch.annotations.FieldIndex.*; | import static org.springframework.data.elasticsearch.annotations.FieldIndex.*; | ||||||
| @ -15,6 +30,9 @@ import org.springframework.data.elasticsearch.annotations.NestedField; | |||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Simple type to test facets |  * Simple type to test facets | ||||||
|  |  * | ||||||
|  |  * @author Artur Konczak | ||||||
|  |  * @author Mohsin Husen | ||||||
|  */ |  */ | ||||||
| @Document(indexName = "articles", type = "article", shards = 1, replicas = 0, refreshInterval = "-1", indexStoreType = "memory") | @Document(indexName = "articles", type = "article", shards = 1, replicas = 0, refreshInterval = "-1", indexStoreType = "memory") | ||||||
| public class ArticleEntity { | public class ArticleEntity { | ||||||
|  | |||||||
| @ -1,9 +1,27 @@ | |||||||
|  | /* | ||||||
|  |  * Copyright 2014 the original author or authors. | ||||||
|  |  * | ||||||
|  |  * Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
|  |  * you may not use this file except in compliance with the License. | ||||||
|  |  * You may obtain a copy of the License at | ||||||
|  |  * | ||||||
|  |  *      http://www.apache.org/licenses/LICENSE-2.0 | ||||||
|  |  * | ||||||
|  |  * Unless required by applicable law or agreed to in writing, software | ||||||
|  |  * distributed under the License is distributed on an "AS IS" BASIS, | ||||||
|  |  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||
|  |  * See the License for the specific language governing permissions and | ||||||
|  |  * limitations under the License. | ||||||
|  |  */ | ||||||
| package org.springframework.data.elasticsearch.core.facet; | package org.springframework.data.elasticsearch.core.facet; | ||||||
| 
 | 
 | ||||||
| import org.springframework.data.elasticsearch.core.query.IndexQuery; | import org.springframework.data.elasticsearch.core.query.IndexQuery; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Simple type to test facets |  * Simple type to test facets | ||||||
|  |  * | ||||||
|  |  * @author Artur Konczak | ||||||
|  |  * @author Mohsin Husen | ||||||
|  */ |  */ | ||||||
| public class ArticleEntityBuilder { | public class ArticleEntityBuilder { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,3 +1,18 @@ | |||||||
|  | /* | ||||||
|  |  * Copyright 2014 the original author or authors. | ||||||
|  |  * | ||||||
|  |  * Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
|  |  * you may not use this file except in compliance with the License. | ||||||
|  |  * You may obtain a copy of the License at | ||||||
|  |  * | ||||||
|  |  *      http://www.apache.org/licenses/LICENSE-2.0 | ||||||
|  |  * | ||||||
|  |  * Unless required by applicable law or agreed to in writing, software | ||||||
|  |  * distributed under the License is distributed on an "AS IS" BASIS, | ||||||
|  |  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||
|  |  * See the License for the specific language governing permissions and | ||||||
|  |  * limitations under the License. | ||||||
|  |  */ | ||||||
| package org.springframework.data.elasticsearch.core.facet; | package org.springframework.data.elasticsearch.core.facet; | ||||||
| 
 | 
 | ||||||
| import java.text.SimpleDateFormat; | import java.text.SimpleDateFormat; | ||||||
| @ -10,10 +25,12 @@ import org.springframework.data.elasticsearch.annotations.Field; | |||||||
| import org.springframework.data.elasticsearch.annotations.FieldType; | import org.springframework.data.elasticsearch.annotations.FieldType; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * User: Artur Konczak |  * Simple type to test facets | ||||||
|  * Date: 18/10/13 |  * | ||||||
|  * Time: 17:33 |  * @author Artur Konczak | ||||||
|  |  * @author Mohsin Husen | ||||||
|  */ |  */ | ||||||
|  | 
 | ||||||
| @Document(indexName = "logs", type = "log", shards = 1, replicas = 0, refreshInterval = "-1", indexStoreType = "memory") | @Document(indexName = "logs", type = "log", shards = 1, replicas = 0, refreshInterval = "-1", indexStoreType = "memory") | ||||||
| public class LogEntity { | public class LogEntity { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,3 +1,18 @@ | |||||||
|  | /* | ||||||
|  |  * Copyright 2014 the original author or authors. | ||||||
|  |  * | ||||||
|  |  * Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
|  |  * you may not use this file except in compliance with the License. | ||||||
|  |  * You may obtain a copy of the License at | ||||||
|  |  * | ||||||
|  |  *      http://www.apache.org/licenses/LICENSE-2.0 | ||||||
|  |  * | ||||||
|  |  * Unless required by applicable law or agreed to in writing, software | ||||||
|  |  * distributed under the License is distributed on an "AS IS" BASIS, | ||||||
|  |  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||
|  |  * See the License for the specific language governing permissions and | ||||||
|  |  * limitations under the License. | ||||||
|  |  */ | ||||||
| package org.springframework.data.elasticsearch.core.facet; | package org.springframework.data.elasticsearch.core.facet; | ||||||
| 
 | 
 | ||||||
| import java.util.Date; | import java.util.Date; | ||||||
| @ -5,10 +20,12 @@ import java.util.Date; | |||||||
| import org.springframework.data.elasticsearch.core.query.IndexQuery; | import org.springframework.data.elasticsearch.core.query.IndexQuery; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * User: Artur Konczak |  * Simple type to test facets | ||||||
|  * Date: 18/10/13 |  * | ||||||
|  * Time: 17:33 |  * @author Artur Konczak | ||||||
|  |  * @author Mohsin Husen | ||||||
|  */ |  */ | ||||||
|  | 
 | ||||||
| public class LogEntityBuilder { | public class LogEntityBuilder { | ||||||
| 
 | 
 | ||||||
| 	private LogEntity result; | 	private LogEntity result; | ||||||
|  | |||||||
| @ -17,6 +17,11 @@ package org.springframework.data.elasticsearch.core.geo; | |||||||
| 
 | 
 | ||||||
| import org.springframework.data.elasticsearch.core.query.IndexQuery; | import org.springframework.data.elasticsearch.core.query.IndexQuery; | ||||||
| 
 | 
 | ||||||
|  | /** | ||||||
|  |  * @author Artur Konczak | ||||||
|  |  * @author Mohsin Husen | ||||||
|  |  */ | ||||||
|  | 
 | ||||||
| public class AuthorMarkerAnnotatedEntityBuilder { | public class AuthorMarkerAnnotatedEntityBuilder { | ||||||
| 
 | 
 | ||||||
| 	private AuthorMarkerAnnotatedEntity result; | 	private AuthorMarkerAnnotatedEntity result; | ||||||
|  | |||||||
| @ -24,7 +24,6 @@ import java.util.List; | |||||||
| 
 | 
 | ||||||
| import org.elasticsearch.common.geo.GeoHashUtils; | import org.elasticsearch.common.geo.GeoHashUtils; | ||||||
| import org.elasticsearch.index.query.FilterBuilders; | import org.elasticsearch.index.query.FilterBuilders; | ||||||
| import org.junit.Before; |  | ||||||
| import org.junit.Test; | import org.junit.Test; | ||||||
| import org.junit.runner.RunWith; | import org.junit.runner.RunWith; | ||||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||||
| @ -49,11 +48,6 @@ public class ElasticsearchTemplateGeoTests { | |||||||
| 	@Autowired | 	@Autowired | ||||||
| 	private ElasticsearchTemplate elasticsearchTemplate; | 	private ElasticsearchTemplate elasticsearchTemplate; | ||||||
| 
 | 
 | ||||||
| 	@Before |  | ||||||
| 	public void before() { |  | ||||||
| 
 |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	private void loadClassBaseEntities() { | 	private void loadClassBaseEntities() { | ||||||
| 		elasticsearchTemplate.deleteIndex(AuthorMarkerEntity.class); | 		elasticsearchTemplate.deleteIndex(AuthorMarkerEntity.class); | ||||||
| 		elasticsearchTemplate.createIndex(AuthorMarkerEntity.class); | 		elasticsearchTemplate.createIndex(AuthorMarkerEntity.class); | ||||||
|  | |||||||
| @ -28,9 +28,9 @@ import org.junit.Test; | |||||||
| import org.junit.runner.RunWith; | import org.junit.runner.RunWith; | ||||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||||
| import org.springframework.data.domain.Page; | import org.springframework.data.domain.Page; | ||||||
| import org.springframework.data.elasticsearch.SampleEntity; | import org.springframework.data.elasticsearch.builder.SampleEntityBuilder; | ||||||
| import org.springframework.data.elasticsearch.SampleEntityBuilder; |  | ||||||
| import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; | import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; | ||||||
|  | import org.springframework.data.elasticsearch.entities.SampleEntity; | ||||||
| import org.springframework.test.context.ContextConfiguration; | import org.springframework.test.context.ContextConfiguration; | ||||||
| import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -13,7 +13,7 @@ | |||||||
|  * See the License for the specific language governing permissions and |  * See the License for the specific language governing permissions and | ||||||
|  * limitations under the License. |  * limitations under the License. | ||||||
|  */ |  */ | ||||||
| package org.springframework.data.elasticsearch; | package org.springframework.data.elasticsearch.entities; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * @author Rizwan Idrees |  * @author Rizwan Idrees | ||||||
| @ -13,7 +13,7 @@ | |||||||
|  * See the License for the specific language governing permissions and |  * See the License for the specific language governing permissions and | ||||||
|  * limitations under the License. |  * limitations under the License. | ||||||
|  */ |  */ | ||||||
| package org.springframework.data.elasticsearch; | package org.springframework.data.elasticsearch.entities; | ||||||
| 
 | 
 | ||||||
| import org.springframework.data.annotation.Id; | import org.springframework.data.annotation.Id; | ||||||
| import org.springframework.data.elasticsearch.annotations.Document; | import org.springframework.data.elasticsearch.annotations.Document; | ||||||
| @ -13,7 +13,7 @@ | |||||||
|  * See the License for the specific language governing permissions and |  * See the License for the specific language governing permissions and | ||||||
|  * limitations under the License. |  * limitations under the License. | ||||||
|  */ |  */ | ||||||
| package org.springframework.data.elasticsearch; | package org.springframework.data.elasticsearch.entities; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * @author Rizwan Idrees |  * @author Rizwan Idrees | ||||||
| @ -13,7 +13,7 @@ | |||||||
|  * See the License for the specific language governing permissions and |  * See the License for the specific language governing permissions and | ||||||
|  * limitations under the License. |  * limitations under the License. | ||||||
|  */ |  */ | ||||||
| package org.springframework.data.elasticsearch; | package org.springframework.data.elasticsearch.entities; | ||||||
| 
 | 
 | ||||||
| import org.springframework.data.annotation.Id; | import org.springframework.data.annotation.Id; | ||||||
| import org.springframework.data.annotation.Version; | import org.springframework.data.annotation.Version; | ||||||
| @ -13,7 +13,7 @@ | |||||||
|  * See the License for the specific language governing permissions and |  * See the License for the specific language governing permissions and | ||||||
|  * limitations under the License. |  * limitations under the License. | ||||||
|  */ |  */ | ||||||
| package org.springframework.data.elasticsearch; | package org.springframework.data.elasticsearch.entities; | ||||||
| 
 | 
 | ||||||
| import java.util.List; | import java.util.List; | ||||||
| 
 | 
 | ||||||
| @ -13,7 +13,7 @@ | |||||||
|  * See the License for the specific language governing permissions and |  * See the License for the specific language governing permissions and | ||||||
|  * limitations under the License. |  * limitations under the License. | ||||||
|  */ |  */ | ||||||
| package org.springframework.data.elasticsearch; | package org.springframework.data.elasticsearch.entities; | ||||||
| 
 | 
 | ||||||
| import org.springframework.data.annotation.Id; | import org.springframework.data.annotation.Id; | ||||||
| import org.springframework.data.annotation.Version; | import org.springframework.data.annotation.Version; | ||||||
| @ -13,7 +13,7 @@ | |||||||
|  * See the License for the specific language governing permissions and |  * See the License for the specific language governing permissions and | ||||||
|  * limitations under the License. |  * limitations under the License. | ||||||
|  */ |  */ | ||||||
| package org.springframework.data.elasticsearch; | package org.springframework.data.elasticsearch.entities; | ||||||
| 
 | 
 | ||||||
| import org.springframework.data.annotation.Id; | import org.springframework.data.annotation.Id; | ||||||
| import org.springframework.data.elasticsearch.annotations.Document; | import org.springframework.data.elasticsearch.annotations.Document; | ||||||
| @ -13,7 +13,7 @@ | |||||||
|  * See the License for the specific language governing permissions and |  * See the License for the specific language governing permissions and | ||||||
|  * limitations under the License. |  * limitations under the License. | ||||||
|  */ |  */ | ||||||
| package org.springframework.data.elasticsearch; | package org.springframework.data.elasticsearch.entities; | ||||||
| 
 | 
 | ||||||
| import org.springframework.data.annotation.Id; | import org.springframework.data.annotation.Id; | ||||||
| 
 | 
 | ||||||
| @ -13,7 +13,7 @@ | |||||||
|  * See the License for the specific language governing permissions and |  * See the License for the specific language governing permissions and | ||||||
|  * limitations under the License. |  * limitations under the License. | ||||||
|  */ |  */ | ||||||
| package org.springframework.data.elasticsearch; | package org.springframework.data.elasticsearch.entities; | ||||||
| 
 | 
 | ||||||
| import org.springframework.core.style.ToStringCreator; | import org.springframework.core.style.ToStringCreator; | ||||||
| import org.springframework.data.annotation.Id; | import org.springframework.data.annotation.Id; | ||||||
| @ -13,7 +13,7 @@ | |||||||
|  * See the License for the specific language governing permissions and |  * See the License for the specific language governing permissions and | ||||||
|  * limitations under the License. |  * limitations under the License. | ||||||
|  */ |  */ | ||||||
| package org.springframework.data.elasticsearch; | package org.springframework.data.elasticsearch.entities; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| import java.util.List; | import java.util.List; | ||||||
| @ -13,7 +13,7 @@ | |||||||
|  * See the License for the specific language governing permissions and |  * See the License for the specific language governing permissions and | ||||||
|  * limitations under the License. |  * limitations under the License. | ||||||
|  */ |  */ | ||||||
| package org.springframework.data.elasticsearch; | package org.springframework.data.elasticsearch.entities; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| import java.util.List; | import java.util.List; | ||||||
| @ -13,7 +13,7 @@ | |||||||
|  * See the License for the specific language governing permissions and |  * See the License for the specific language governing permissions and | ||||||
|  * limitations under the License. |  * limitations under the License. | ||||||
|  */ |  */ | ||||||
| package org.springframework.data.elasticsearch; | package org.springframework.data.elasticsearch.entities; | ||||||
| 
 | 
 | ||||||
| import java.util.Date; | import java.util.Date; | ||||||
| import java.util.List; | import java.util.List; | ||||||
| @ -1,4 +1,4 @@ | |||||||
| package org.springframework.data.elasticsearch; | package org.springframework.data.elasticsearch.entities; | ||||||
| 
 | 
 | ||||||
| import static org.springframework.data.elasticsearch.annotations.FieldIndex.*; | import static org.springframework.data.elasticsearch.annotations.FieldIndex.*; | ||||||
| import static org.springframework.data.elasticsearch.annotations.FieldType.*; | import static org.springframework.data.elasticsearch.annotations.FieldType.*; | ||||||
| @ -13,7 +13,7 @@ | |||||||
|  * See the License for the specific language governing permissions and |  * See the License for the specific language governing permissions and | ||||||
|  * limitations under the License. |  * limitations under the License. | ||||||
|  */ |  */ | ||||||
| package org.springframework.data.elasticsearch; | package org.springframework.data.elasticsearch.entities; | ||||||
| 
 | 
 | ||||||
| import org.apache.commons.lang.builder.EqualsBuilder; | import org.apache.commons.lang.builder.EqualsBuilder; | ||||||
| import org.apache.commons.lang.builder.HashCodeBuilder; | import org.apache.commons.lang.builder.HashCodeBuilder; | ||||||
| @ -13,7 +13,7 @@ | |||||||
|  * See the License for the specific language governing permissions and |  * See the License for the specific language governing permissions and | ||||||
|  * limitations under the License. |  * limitations under the License. | ||||||
|  */ |  */ | ||||||
| package org.springframework.data.elasticsearch; | package org.springframework.data.elasticsearch.entities; | ||||||
| 
 | 
 | ||||||
| import static org.springframework.data.elasticsearch.annotations.FieldIndex.*; | import static org.springframework.data.elasticsearch.annotations.FieldIndex.*; | ||||||
| import static org.springframework.data.elasticsearch.annotations.FieldType.String; | import static org.springframework.data.elasticsearch.annotations.FieldType.String; | ||||||
| @ -13,7 +13,7 @@ | |||||||
|  * See the License for the specific language governing permissions and |  * See the License for the specific language governing permissions and | ||||||
|  * limitations under the License. |  * limitations under the License. | ||||||
|  */ |  */ | ||||||
| package org.springframework.data.elasticsearch; | package org.springframework.data.elasticsearch.entities; | ||||||
| 
 | 
 | ||||||
| import static org.springframework.data.elasticsearch.annotations.FieldIndex.*; | import static org.springframework.data.elasticsearch.annotations.FieldIndex.*; | ||||||
| import static org.springframework.data.elasticsearch.annotations.FieldType.String; | import static org.springframework.data.elasticsearch.annotations.FieldType.String; | ||||||
| @ -13,7 +13,7 @@ | |||||||
|  * See the License for the specific language governing permissions and |  * See the License for the specific language governing permissions and | ||||||
|  * limitations under the License. |  * limitations under the License. | ||||||
|  */ |  */ | ||||||
| package org.springframework.data.elasticsearch; | package org.springframework.data.elasticsearch.entities; | ||||||
| 
 | 
 | ||||||
| import org.springframework.data.annotation.Id; | import org.springframework.data.annotation.Id; | ||||||
| import org.springframework.data.elasticsearch.annotations.Document; | import org.springframework.data.elasticsearch.annotations.Document; | ||||||
| @ -13,7 +13,7 @@ | |||||||
|  * See the License for the specific language governing permissions and |  * See the License for the specific language governing permissions and | ||||||
|  * limitations under the License. |  * limitations under the License. | ||||||
|  */ |  */ | ||||||
| package org.springframework.data.elasticsearch; | package org.springframework.data.elasticsearch.entities; | ||||||
| 
 | 
 | ||||||
| import java.math.BigDecimal; | import java.math.BigDecimal; | ||||||
| 
 | 
 | ||||||
| @ -29,8 +29,8 @@ import org.springframework.beans.factory.annotation.Autowired; | |||||||
| import org.springframework.data.domain.Page; | import org.springframework.data.domain.Page; | ||||||
| import org.springframework.data.domain.PageRequest; | import org.springframework.data.domain.PageRequest; | ||||||
| import org.springframework.data.domain.Sort; | import org.springframework.data.domain.Sort; | ||||||
| import org.springframework.data.elasticsearch.SampleEntity; |  | ||||||
| import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; | import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; | ||||||
|  | import org.springframework.data.elasticsearch.entities.SampleEntity; | ||||||
| import org.springframework.data.elasticsearch.repositories.custom.SampleCustomMethodRepository; | import org.springframework.data.elasticsearch.repositories.custom.SampleCustomMethodRepository; | ||||||
| import org.springframework.test.context.ContextConfiguration; | import org.springframework.test.context.ContextConfiguration; | ||||||
| import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | ||||||
|  | |||||||
| @ -15,7 +15,7 @@ | |||||||
|  */ |  */ | ||||||
| package org.springframework.data.elasticsearch.repositories.book; | package org.springframework.data.elasticsearch.repositories.book; | ||||||
| 
 | 
 | ||||||
| import org.springframework.data.elasticsearch.Book; | import org.springframework.data.elasticsearch.entities.Book; | ||||||
| import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; | import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  | |||||||
| @ -15,7 +15,7 @@ | |||||||
|  */ |  */ | ||||||
| package org.springframework.data.elasticsearch.repositories.cdi; | package org.springframework.data.elasticsearch.repositories.cdi; | ||||||
| 
 | 
 | ||||||
| import org.springframework.data.elasticsearch.Product; | import org.springframework.data.elasticsearch.entities.Product; | ||||||
| import org.springframework.data.repository.CrudRepository; | import org.springframework.data.repository.CrudRepository; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  | |||||||
| @ -23,7 +23,7 @@ import org.junit.AfterClass; | |||||||
| import org.junit.Before; | import org.junit.Before; | ||||||
| import org.junit.BeforeClass; | import org.junit.BeforeClass; | ||||||
| import org.junit.Test; | import org.junit.Test; | ||||||
| import org.springframework.data.elasticsearch.Product; | import org.springframework.data.elasticsearch.entities.Product; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * @author Mohsin Husen |  * @author Mohsin Husen | ||||||
|  | |||||||
| @ -19,8 +19,8 @@ import java.util.List; | |||||||
| 
 | 
 | ||||||
| import org.springframework.data.domain.Page; | import org.springframework.data.domain.Page; | ||||||
| import org.springframework.data.domain.Pageable; | import org.springframework.data.domain.Pageable; | ||||||
| import org.springframework.data.elasticsearch.SampleEntity; |  | ||||||
| import org.springframework.data.elasticsearch.annotations.Query; | import org.springframework.data.elasticsearch.annotations.Query; | ||||||
|  | import org.springframework.data.elasticsearch.entities.SampleEntity; | ||||||
| import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; | import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  | |||||||
| @ -15,7 +15,7 @@ | |||||||
|  */ |  */ | ||||||
| package org.springframework.data.elasticsearch.repositories.doubleid; | package org.springframework.data.elasticsearch.repositories.doubleid; | ||||||
| 
 | 
 | ||||||
| import org.springframework.data.elasticsearch.DoubleIDEntity; | import org.springframework.data.elasticsearch.entities.DoubleIDEntity; | ||||||
| import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; | import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  | |||||||
| @ -15,7 +15,7 @@ | |||||||
|  */ |  */ | ||||||
| package org.springframework.data.elasticsearch.repositories.integer; | package org.springframework.data.elasticsearch.repositories.integer; | ||||||
| 
 | 
 | ||||||
| import org.springframework.data.elasticsearch.IntegerIDEntity; | import org.springframework.data.elasticsearch.entities.IntegerIDEntity; | ||||||
| import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; | import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  | |||||||
| @ -16,7 +16,7 @@ | |||||||
| package org.springframework.data.elasticsearch.repositories.nondocument; | package org.springframework.data.elasticsearch.repositories.nondocument; | ||||||
| 
 | 
 | ||||||
| import org.springframework.context.annotation.Lazy; | import org.springframework.context.annotation.Lazy; | ||||||
| import org.springframework.data.elasticsearch.NonDocumentEntity; | import org.springframework.data.elasticsearch.entities.NonDocumentEntity; | ||||||
| import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; | import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  | |||||||
| @ -15,7 +15,7 @@ | |||||||
|  */ |  */ | ||||||
| package org.springframework.data.elasticsearch.repositories.sample; | package org.springframework.data.elasticsearch.repositories.sample; | ||||||
| 
 | 
 | ||||||
| import org.springframework.data.elasticsearch.SampleEntity; | import org.springframework.data.elasticsearch.entities.SampleEntity; | ||||||
| import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; | import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  | |||||||
| @ -22,8 +22,8 @@ import org.junit.Before; | |||||||
| import org.junit.Test; | import org.junit.Test; | ||||||
| import org.junit.runner.RunWith; | import org.junit.runner.RunWith; | ||||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||||
| import org.springframework.data.elasticsearch.SampleEntity; |  | ||||||
| import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; | import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; | ||||||
|  | import org.springframework.data.elasticsearch.entities.SampleEntity; | ||||||
| import org.springframework.test.context.ContextConfiguration; | import org.springframework.test.context.ContextConfiguration; | ||||||
| import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -22,8 +22,8 @@ import org.junit.Before; | |||||||
| import org.junit.Test; | import org.junit.Test; | ||||||
| import org.junit.runner.RunWith; | import org.junit.runner.RunWith; | ||||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||||
| import org.springframework.data.elasticsearch.SampleEntity; |  | ||||||
| import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; | import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; | ||||||
|  | import org.springframework.data.elasticsearch.entities.SampleEntity; | ||||||
| import org.springframework.test.context.ContextConfiguration; | import org.springframework.test.context.ContextConfiguration; | ||||||
| import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -15,7 +15,7 @@ | |||||||
|  */ |  */ | ||||||
| package org.springframework.data.elasticsearch.repository.complex; | package org.springframework.data.elasticsearch.repository.complex; | ||||||
| 
 | 
 | ||||||
| import org.springframework.data.elasticsearch.SampleEntity; | import org.springframework.data.elasticsearch.entities.SampleEntity; | ||||||
| import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; | import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  | |||||||
| @ -15,7 +15,7 @@ | |||||||
|  */ |  */ | ||||||
| package org.springframework.data.elasticsearch.repository.complex; | package org.springframework.data.elasticsearch.repository.complex; | ||||||
| 
 | 
 | ||||||
| import org.springframework.data.elasticsearch.SampleEntity; | import org.springframework.data.elasticsearch.entities.SampleEntity; | ||||||
| import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; | import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  | |||||||
| @ -25,8 +25,8 @@ import org.junit.Before; | |||||||
| import org.junit.Test; | import org.junit.Test; | ||||||
| import org.junit.runner.RunWith; | import org.junit.runner.RunWith; | ||||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||||
| import org.springframework.data.elasticsearch.DoubleIDEntity; |  | ||||||
| import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; | import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; | ||||||
|  | import org.springframework.data.elasticsearch.entities.DoubleIDEntity; | ||||||
| import org.springframework.data.elasticsearch.repositories.doubleid.DoubleIDRepository; | import org.springframework.data.elasticsearch.repositories.doubleid.DoubleIDRepository; | ||||||
| import org.springframework.test.context.ContextConfiguration; | import org.springframework.test.context.ContextConfiguration; | ||||||
| import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | ||||||
|  | |||||||
| @ -25,8 +25,8 @@ import org.junit.Before; | |||||||
| import org.junit.Test; | import org.junit.Test; | ||||||
| import org.junit.runner.RunWith; | import org.junit.runner.RunWith; | ||||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||||
| import org.springframework.data.elasticsearch.IntegerIDEntity; |  | ||||||
| import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; | import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; | ||||||
|  | import org.springframework.data.elasticsearch.entities.IntegerIDEntity; | ||||||
| import org.springframework.data.elasticsearch.repositories.integer.IntegerIDRepository; | import org.springframework.data.elasticsearch.repositories.integer.IntegerIDRepository; | ||||||
| import org.springframework.test.context.ContextConfiguration; | import org.springframework.test.context.ContextConfiguration; | ||||||
| import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | ||||||
|  | |||||||
| @ -32,10 +32,10 @@ import org.springframework.beans.factory.annotation.Autowired; | |||||||
| import org.springframework.data.domain.Page; | import org.springframework.data.domain.Page; | ||||||
| import org.springframework.data.domain.PageRequest; | import org.springframework.data.domain.PageRequest; | ||||||
| import org.springframework.data.domain.Sort; | import org.springframework.data.domain.Sort; | ||||||
| import org.springframework.data.elasticsearch.SampleEntity; |  | ||||||
| import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; | import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; | ||||||
| import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder; | import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder; | ||||||
| import org.springframework.data.elasticsearch.core.query.SearchQuery; | import org.springframework.data.elasticsearch.core.query.SearchQuery; | ||||||
|  | import org.springframework.data.elasticsearch.entities.SampleEntity; | ||||||
| import org.springframework.data.elasticsearch.repositories.sample.SampleElasticsearchRepository; | import org.springframework.data.elasticsearch.repositories.sample.SampleElasticsearchRepository; | ||||||
| import org.springframework.test.context.ContextConfiguration; | import org.springframework.test.context.ContextConfiguration; | ||||||
| import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user