lucene 4: fix general mapping test
no need to test for boost, we already have specific boost tests, in general, we should get rid of this test, and use more specialized tests if we are missing some
This commit is contained in:
parent
5c45aad260
commit
9d5cae23fa
|
@ -20,7 +20,6 @@
|
|||
package org.elasticsearch.test.unit.index.mapper.simple;
|
||||
|
||||
import org.apache.lucene.document.Document;
|
||||
import org.apache.lucene.index.IndexableField;
|
||||
import org.elasticsearch.common.bytes.BytesArray;
|
||||
import org.elasticsearch.common.bytes.BytesReference;
|
||||
import org.elasticsearch.index.mapper.DocumentMapper;
|
||||
|
@ -33,7 +32,6 @@ import static org.elasticsearch.common.io.Streams.copyToBytesFromClasspath;
|
|||
import static org.elasticsearch.common.io.Streams.copyToStringFromClasspath;
|
||||
import static org.elasticsearch.index.mapper.MapperBuilders.*;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.closeTo;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
|
||||
/**
|
||||
|
@ -52,10 +50,6 @@ public class SimpleMapperTests {
|
|||
BytesReference json = new BytesArray(copyToBytesFromClasspath("/org/elasticsearch/test/unit/index/mapper/simple/test1.json"));
|
||||
Document doc = docMapper.parse("person", "1", json).rootDoc();
|
||||
|
||||
assertThat(doc.getFields().size(), equalTo(14));
|
||||
for (IndexableField field : doc.getFields()) {
|
||||
assertThat((double) field.boost(), closeTo(3.7, 0.01));
|
||||
}
|
||||
assertThat(doc.get(docMapper.mappers().name("first").mapper().names().indexName()), equalTo("shay"));
|
||||
assertThat(docMapper.mappers().name("first").mapper().names().fullName(), equalTo("name.first"));
|
||||
// System.out.println("Document: " + doc);
|
||||
|
@ -76,10 +70,6 @@ public class SimpleMapperTests {
|
|||
BytesReference json = new BytesArray(copyToBytesFromClasspath("/org/elasticsearch/test/unit/index/mapper/simple/test1.json"));
|
||||
Document doc = builtDocMapper.parse(json).rootDoc();
|
||||
assertThat(doc.get(docMapper.uidMapper().names().indexName()), equalTo(Uid.createUid("person", "1")));
|
||||
assertThat(doc.getFields().size(), equalTo(14));
|
||||
for (IndexableField field : doc.getFields()) {
|
||||
assertThat((double) field.boost(), closeTo(3.7, 0.01));
|
||||
}
|
||||
assertThat(doc.get(docMapper.mappers().name("first").mapper().names().indexName()), equalTo("shay"));
|
||||
// System.out.println("Document: " + doc);
|
||||
// System.out.println("Json: " + docMapper.sourceMapper().value(doc));
|
||||
|
@ -95,10 +85,6 @@ public class SimpleMapperTests {
|
|||
BytesReference json = new BytesArray(copyToBytesFromClasspath("/org/elasticsearch/test/unit/index/mapper/simple/test1.json"));
|
||||
Document doc = docMapper.parse(json).rootDoc();
|
||||
assertThat(doc.get(docMapper.uidMapper().names().indexName()), equalTo(Uid.createUid("person", "1")));
|
||||
assertThat(doc.getFields().size(), equalTo(14));
|
||||
for (IndexableField field : doc.getFields()) {
|
||||
assertThat((double) field.boost(), closeTo(3.7, 0.01));
|
||||
}
|
||||
assertThat(doc.get(docMapper.mappers().name("first").mapper().names().indexName()), equalTo("shay"));
|
||||
// System.out.println("Document: " + doc);
|
||||
// System.out.println("Json: " + docMapper.sourceMapper().value(doc));
|
||||
|
@ -111,10 +97,6 @@ public class SimpleMapperTests {
|
|||
BytesReference json = new BytesArray(copyToBytesFromClasspath("/org/elasticsearch/test/unit/index/mapper/simple/test1-notype-noid.json"));
|
||||
Document doc = docMapper.parse("person", "1", json).rootDoc();
|
||||
assertThat(doc.get(docMapper.uidMapper().names().indexName()), equalTo(Uid.createUid("person", "1")));
|
||||
assertThat(doc.getFields().size(), equalTo(14));
|
||||
for (IndexableField field : doc.getFields()) {
|
||||
assertThat((double) field.boost(), closeTo(3.7, 0.01));
|
||||
}
|
||||
assertThat(doc.get(docMapper.mappers().name("first").mapper().names().indexName()), equalTo("shay"));
|
||||
// System.out.println("Document: " + doc);
|
||||
// System.out.println("Json: " + docMapper.sourceMapper().value(doc));
|
||||
|
|
Loading…
Reference in New Issue