use of com.yahoo.vespa.config.search.vsm.VsmfieldsConfig in project vespa by vespa-engine.
the class VsmFieldsTestCase method reference_type_field_is_unsearchable.
@Test
public void reference_type_field_is_unsearchable() {
Search search = new Search("test", MockApplicationPackage.createEmpty());
search.addDocument(new SDDocumentType("test"));
SDField refField = new TemporarySDField("ref_field", ReferenceDataType.createWithInferredId(TemporaryStructuredDataType.create("parent_type")));
refField.parseIndexingScript("{ summary }");
search.getDocument().addField(refField);
VsmFields vsmFields = new VsmFields(search);
VsmfieldsConfig.Builder cfgBuilder = new VsmfieldsConfig.Builder();
vsmFields.getConfig(cfgBuilder);
VsmfieldsConfig cfg = new VsmfieldsConfig(cfgBuilder);
assertEquals(1, cfg.fieldspec().size());
VsmfieldsConfig.Fieldspec fieldSpec = cfg.fieldspec().get(0);
assertEquals("ref_field", fieldSpec.name());
assertEquals(VsmfieldsConfig.Fieldspec.Searchmethod.NONE, fieldSpec.searchmethod());
}
Aggregations