parent/child: Removed AwaitsFix annotation

Closes #9461
This commit is contained in:
Martijn van Groningen 2015-07-14 20:05:20 +02:00
parent 0808c98eeb
commit f5e351aaf1
2 changed files with 4 additions and 15 deletions

View File

@ -397,6 +397,10 @@ public class ParentChildIndexFieldData extends AbstractIndexFieldData<AtomicPare
@Override @Override
public SortedDocValues getOrdinalsValues(String type) { public SortedDocValues getOrdinalsValues(String type) {
final OrdinalMapAndAtomicFieldData atomicFD = this.atomicFD.get(type); final OrdinalMapAndAtomicFieldData atomicFD = this.atomicFD.get(type);
if (atomicFD == null) {
return DocValues.emptySorted();
}
final OrdinalMap ordMap = atomicFD.ordMap; final OrdinalMap ordMap = atomicFD.ordMap;
final SortedDocValues[] allSegmentValues = new SortedDocValues[atomicFD.fieldData.length]; final SortedDocValues[] allSegmentValues = new SortedDocValues[atomicFD.fieldData.length];
for (int i = 0; i < allSegmentValues.length; ++i) { for (int i = 0; i < allSegmentValues.length; ++i) {

View File

@ -18,7 +18,6 @@
*/ */
package org.elasticsearch.search.child; package org.elasticsearch.search.child;
import org.apache.lucene.util.LuceneTestCase;
import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse; import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse;
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingResponse; import org.elasticsearch.action.admin.indices.mapping.put.PutMappingResponse;
import org.elasticsearch.action.count.CountResponse; import org.elasticsearch.action.count.CountResponse;
@ -2013,7 +2012,6 @@ public class ChildQuerySearchTests extends ElasticsearchIntegrationTest {
} }
@Test @Test
@LuceneTestCase.AwaitsFix(bugUrl = "https://github.com/elasticsearch/elasticsearch/issues/9461")
public void testParentFieldToNonExistingType() { public void testParentFieldToNonExistingType() {
assertAcked(prepareCreate("test").addMapping("parent").addMapping("child", "_parent", "type=parent2")); assertAcked(prepareCreate("test").addMapping("parent").addMapping("child", "_parent", "type=parent2"));
client().prepareIndex("test", "parent", "1").setSource("{}").get(); client().prepareIndex("test", "parent", "1").setSource("{}").get();
@ -2032,19 +2030,6 @@ public class ChildQuerySearchTests extends ElasticsearchIntegrationTest {
.setQuery(QueryBuilders.hasParentQuery("parent", matchAllQuery())) .setQuery(QueryBuilders.hasParentQuery("parent", matchAllQuery()))
.get(); .get();
assertHitCount(response, 0); assertHitCount(response, 0);
try {
client().prepareSearch("test")
.setQuery(QueryBuilders.constantScoreQuery(QueryBuilders.hasChildQuery("child", matchAllQuery())))
.get();
fail();
} catch (SearchPhaseExecutionException e) {
}
response = client().prepareSearch("test")
.setQuery(QueryBuilders.constantScoreQuery(QueryBuilders.hasParentQuery("parent", matchAllQuery())))
.get();
assertHitCount(response, 0);
} }
static HasChildQueryBuilder hasChildQuery(String type, QueryBuilder queryBuilder) { static HasChildQueryBuilder hasChildQuery(String type, QueryBuilder queryBuilder) {