use of de.tblsoft.solr.pipeline.bean.Document in project solr-cmd-utils by tblsoft.
the class DocumentDifferTest method testCreateField.
@Test
public void testCreateField() {
Document document1 = DocumentBuilder.document().field("foo", "bar").create();
Document document2 = DocumentBuilder.document().field("foo", "bar").field("change", "new").create();
DocumentDiff diff = DocumentDiffer.compare(document1, document2);
Assert.assertEquals(1, diff.getFieldDiffs().size());
Assert.assertEquals(FieldDiff.DiffType.CREATE, diff.getFieldDiffs().get(0).getDiffType());
}
use of de.tblsoft.solr.pipeline.bean.Document in project solr-cmd-utils by tblsoft.
the class DocumentDifferTest method testDeleteField.
@Test
public void testDeleteField() {
Document document1 = DocumentBuilder.document().field("foo", "bar").field("change", "old").create();
Document document2 = DocumentBuilder.document().field("foo", "bar").create();
DocumentDiff diff = DocumentDiffer.compare(document1, document2);
Assert.assertEquals(1, diff.getFieldDiffs().size());
Assert.assertEquals(FieldDiff.DiffType.DELETE, diff.getFieldDiffs().get(0).getDiffType());
}
use of de.tblsoft.solr.pipeline.bean.Document in project solr-cmd-utils by tblsoft.
the class AggregationCountFilterTest method testAggregationCountFilter.
@Test
public void testAggregationCountFilter() {
configure();
Document document1 = DocumentBuilder.document().field("field1", "value1").create();
Document document2 = DocumentBuilder.document().field("field1", "value1").field("field2", "value2").create();
document(document1, document2);
sortDocumentListByField("value");
assertFiled(0, "value", "value1");
assertFiled(0, "count", "2");
assertFiled(0, "type", "field1");
assertFiled(1, "value", "value2");
assertFiled(1, "count", "1");
assertFiled(1, "type", "field2");
assertNumberOfDocuments(2);
assertNumberOfFields(3);
assertInitWasDelegated();
assertEndWasDelegated();
}
use of de.tblsoft.solr.pipeline.bean.Document in project solr-cmd-utils by tblsoft.
the class CompoundWordFilterTest method testBlumenzwiebel.
@Test
@Ignore
public void testBlumenzwiebel() {
configure();
document(DocumentBuilder.document().field("noun", "blumenzwiebel").create(), DocumentBuilder.document().field("noun", "lumen").create(), DocumentBuilder.document().field("noun", "zwiebel").create(), DocumentBuilder.document().field("noun", "deckel").create());
Document d = outputDocumentList.get(0);
assertFiledList("tokenized", "maurer", "hammer");
}
use of de.tblsoft.solr.pipeline.bean.Document in project solr-cmd-utils by tblsoft.
the class BeanTest method testDeleteFieldInDocument.
@Test
public void testDeleteFieldInDocument() {
Document document = DocumentBuilder.document().field("foo", "bar").field("john", "doe").create();
document.deleteField("foo");
Assert.assertNull(document.getField("foo"));
Assert.assertEquals("doe", document.getFieldValue("john"));
Assert.assertEquals(1, document.getFields().size());
}
Aggregations