Tests: Do not index dummy documents in ExistsMissingTests.

This way we make sure that there is only one mapping for
_field_names.
This commit is contained in:
Adrien Grand 2014-11-04 09:40:41 +01:00
parent 4ddb0575b5
commit 3e50bce822
2 changed files with 4 additions and 2 deletions

View File

@ -33,7 +33,6 @@ import org.elasticsearch.index.mapper.internal.FieldNamesFieldMapper;
import java.io.IOException;
import java.util.List;
import java.util.Set;
import static org.elasticsearch.index.query.support.QueryParsers.wrapSmartNameFilter;

View File

@ -91,7 +91,10 @@ public class ExistsMissingTests extends ElasticsearchIntegrationTest {
for (Map<String, Object> source : sources) {
reqs.add(client().prepareIndex("idx", "type").setSource(source));
}
indexRandom(true, reqs);
// We do NOT index dummy documents, otherwise the type for these dummy documents
// would have _field_names indexed while the current type might not which might
// confuse the exists/missing parser at query time
indexRandom(true, false, reqs);
final Map<String, Integer> expected = new LinkedHashMap<String, Integer>();
expected.put("foo", 1);