mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-19 19:35:02 +00:00
small refactor
This commit is contained in:
parent
8fa8a72175
commit
2cc4a286f8
@ -80,17 +80,18 @@ public class ConcurrentIndexingVersioningTest {
|
|||||||
System.out.println("done indexing, verifying docs");
|
System.out.println("done indexing, verifying docs");
|
||||||
client.client().admin().indices().prepareRefresh().execute().actionGet();
|
client.client().admin().indices().prepareRefresh().execute().actionGet();
|
||||||
for (int i = 0; i < NUMBER_OF_DOCS; i++) {
|
for (int i = 0; i < NUMBER_OF_DOCS; i++) {
|
||||||
|
String id = Integer.toString(i);
|
||||||
for (int j = 0; j < 5; j++) {
|
for (int j = 0; j < 5; j++) {
|
||||||
SearchResponse response = client.client().prepareSearch().setQuery(QueryBuilders.termQuery("_id", Integer.toString(i))).execute().actionGet();
|
SearchResponse response = client.client().prepareSearch().setQuery(QueryBuilders.termQuery("_id", id)).execute().actionGet();
|
||||||
if (response.hits().totalHits() > 1) {
|
if (response.hits().totalHits() > 1) {
|
||||||
System.err.println("[" + i + "] FAIL, HITS [" + response.hits().totalHits() + "]");
|
System.err.println("[" + i + "] FAIL, HITS [" + response.hits().totalHits() + "]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GetResponse getResponse = client.client().prepareGet("test", "type1", Integer.toString(i)).execute().actionGet();
|
GetResponse getResponse = client.client().prepareGet("test", "type1", id).execute().actionGet();
|
||||||
if (getResponse.exists()) {
|
if (getResponse.exists()) {
|
||||||
long version = getResponse.version();
|
long version = getResponse.version();
|
||||||
for (int j = 0; j < 5; j++) {
|
for (int j = 0; j < 5; j++) {
|
||||||
getResponse = client.client().prepareGet("test", "type1", Integer.toString(i)).execute().actionGet();
|
getResponse = client.client().prepareGet("test", "type1", id).execute().actionGet();
|
||||||
if (!getResponse.exists()) {
|
if (!getResponse.exists()) {
|
||||||
System.err.println("[" + i + "] FAIL, EXISTED, and NOT_EXISTED");
|
System.err.println("[" + i + "] FAIL, EXISTED, and NOT_EXISTED");
|
||||||
break;
|
break;
|
||||||
@ -102,7 +103,7 @@ public class ConcurrentIndexingVersioningTest {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (int j = 0; j < 5; j++) {
|
for (int j = 0; j < 5; j++) {
|
||||||
getResponse = client.client().prepareGet("test", "type1", Integer.toString(i)).execute().actionGet();
|
getResponse = client.client().prepareGet("test", "type1", id).execute().actionGet();
|
||||||
if (getResponse.exists()) {
|
if (getResponse.exists()) {
|
||||||
System.err.println("[" + i + "] FAIL, EXISTED, and NOT_EXISTED");
|
System.err.println("[" + i + "] FAIL, EXISTED, and NOT_EXISTED");
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user