log.debug("Begin test V302");
Record record = defaultTable.newRecord();
record.setRecordType(rt.getName());
Blob blob1 = createBlob("blob2.pdf", "application/pdf", "blob2.pdf");
Blob blob2 = createBlob("blob2.pdf", "application/pdf", "blob2.pdf");
record.setField(field13.getName(), blob1);
record.setField(field14.getName(), blob2);
expectEvent(CREATE, Table.RECORD.name, record.getId(), 1L, null, field13.getId(), field14.getId());
record = defaultTable.create(record);
commitIndex();
// extractContent is not enabled for field13, search on content should not find anything
verifyResultCount("field13_string:tired", 0);
// extractContent is enabled for field14
verifyResultCount("field14_string:tired", 1);
}
//
// Attention: we change the indexerconf here
//
changeIndexUpdater("indexerconf_dynfields_continue.xml");
//
// Test the fall-through behavior (continue="true") of dynamic fields
//
{
log.debug("Begin test V303");
Record record = defaultTable.newRecord();
record.setRecordType(rt.getName());
record.setField(field1.getName(), "mega");
record.setField(field2.getName(), "giga");
expectEvent(CREATE, Table.RECORD.name, record.getId(), 1L, null, field1.getId(), field2.getId());
record = defaultTable.create(record);
commitIndex();
verifyResultCount("dyncont_field1_first_string:mega", 1);
verifyResultCount("dyncont_field2_first_string:giga", 1);
verifyResultCount("dyncont_field1_second_string:mega", 1);
verifyResultCount("dyncont_field2_second_string:giga", 1);
verifyResultCount("dyncont_field1_third_string:mega", 0);
verifyResultCount("dyncont_field2_third_string:giga", 0);
}
//
// Attention: we change the indexerconf here
//
changeIndexUpdater("indexerconf_fulldynamic.xml");
//
// Test a 'fully dynamic' mapping
//
{
log.debug("Begin test V304");
Record record = defaultTable.newRecord();
record.setRecordType(rt.getName());
Blob blob = createBlob("blob2.pdf", "application/pdf", "blob2.pdf");
record.setField(field1.getName(), "gauss");
record.setField(field2.getName(), "hilbert");
record.setField(field4.getName(), new Long(1024));
record.setField(field14.getName(), blob);