Test: Enabled ChildrenTests#testParentWithMultipleBuckets with more logging

This commit is contained in:
Martijn van Groningen 2014-09-10 11:19:10 +02:00
parent cb839b56b2
commit 6f763bded9
1 changed files with 10 additions and 2 deletions

View File

@ -18,7 +18,6 @@
*/ */
package org.elasticsearch.search.aggregations.bucket; package org.elasticsearch.search.aggregations.bucket;
import org.apache.lucene.util.LuceneTestCase;
import org.elasticsearch.action.index.IndexRequestBuilder; import org.elasticsearch.action.index.IndexRequestBuilder;
import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchHit;
@ -152,7 +151,6 @@ public class ChildrenTests extends ElasticsearchIntegrationTest {
} }
@Test @Test
@LuceneTestCase.AwaitsFix(bugUrl = "Order is incorrect, c is sometimes before a...")
public void testParentWithMultipleBuckets() throws Exception { public void testParentWithMultipleBuckets() throws Exception {
SearchResponse searchResponse = client().prepareSearch("test") SearchResponse searchResponse = client().prepareSearch("test")
.setQuery(matchQuery("randomized", false)) .setQuery(matchQuery("randomized", false))
@ -166,6 +164,16 @@ public class ChildrenTests extends ElasticsearchIntegrationTest {
Terms categoryTerms = searchResponse.getAggregations().get("category"); Terms categoryTerms = searchResponse.getAggregations().get("category");
assertThat(categoryTerms.getBuckets().size(), equalTo(3)); assertThat(categoryTerms.getBuckets().size(), equalTo(3));
for (Terms.Bucket bucket : categoryTerms.getBuckets()) {
logger.info("bucket=" + bucket.getKey());
Children childrenBucket = bucket.getAggregations().get("to_comment");
TopHits topHits = childrenBucket.getAggregations().get("top_comments");
logger.info("total_hits={}", topHits.getHits().getTotalHits());
for (SearchHit searchHit : topHits.getHits()) {
logger.info("hit= {} {}", searchHit.sortValues()[0], searchHit.getId());
}
}
Terms.Bucket categoryBucket = categoryTerms.getBucketByKey("a"); Terms.Bucket categoryBucket = categoryTerms.getBucketByKey("a");
assertThat(categoryBucket.getKey(), equalTo("a")); assertThat(categoryBucket.getKey(), equalTo("a"));
assertThat(categoryBucket.getDocCount(), equalTo(3l)); assertThat(categoryBucket.getDocCount(), equalTo(3l));