BAEL-53 - minor formatting changes

This commit is contained in:
Slavisa Baeldung 2016-09-16 15:47:46 +02:00
parent 5f159cab6c
commit 7a0deaceb4

View File

@ -26,7 +26,6 @@ import com.alibaba.fastjson.JSON;
public class ElasticSearchUnitTests { public class ElasticSearchUnitTests {
private List<Person> listOfPersons = new ArrayList<Person>(); private List<Person> listOfPersons = new ArrayList<Person>();
String jsonString = null; String jsonString = null;
Client client = null; Client client = null;
@Before @Before
@ -45,7 +44,6 @@ public class ElasticSearchUnitTests {
String jsonObject = "{\"age\":20,\"dateOfBirth\":1471466076564,\"fullName\":\"John Doe\"}"; String jsonObject = "{\"age\":20,\"dateOfBirth\":1471466076564,\"fullName\":\"John Doe\"}";
IndexResponse response = client.prepareIndex("people", "Doe") IndexResponse response = client.prepareIndex("people", "Doe")
.setSource(jsonObject).get(); .setSource(jsonObject).get();
String id = response.getId();
String index = response.getIndex(); String index = response.getIndex();
String type = response.getType(); String type = response.getType();
assertTrue(response.isCreated()); assertTrue(response.isCreated());
@ -89,8 +87,7 @@ public class ElasticSearchUnitTests {
SearchResponse response2 = client.prepareSearch() SearchResponse response2 = client.prepareSearch()
.setTypes() .setTypes()
.setSearchType(SearchType.DFS_QUERY_THEN_FETCH) .setSearchType(SearchType.DFS_QUERY_THEN_FETCH)
.setPostFilter(QueryBuilders .setPostFilter(QueryBuilders.simpleQueryStringQuery("+John -Doe OR Janette"))
.simpleQueryStringQuery("+John -Doe OR Janette"))
.setFrom(0).setSize(60).setExplain(true) .setFrom(0).setSize(60).setExplain(true)
.execute() .execute()
.actionGet(); .actionGet();
@ -98,8 +95,7 @@ public class ElasticSearchUnitTests {
SearchResponse response3 = client.prepareSearch() SearchResponse response3 = client.prepareSearch()
.setTypes() .setTypes()
.setSearchType(SearchType.DFS_QUERY_THEN_FETCH) .setSearchType(SearchType.DFS_QUERY_THEN_FETCH)
.setPostFilter(QueryBuilders.matchQuery( .setPostFilter(QueryBuilders.matchQuery("John", "Name*"))
"John", "Name*"))
.setFrom(0).setSize(60).setExplain(true) .setFrom(0).setSize(60).setExplain(true)
.execute() .execute()
.actionGet(); .actionGet();