Search in sources :

Example 1 with VsmfieldsConfig

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());
}
Also used : TemporarySDField(com.yahoo.searchdefinition.document.TemporarySDField) SDField(com.yahoo.searchdefinition.document.SDField) SDDocumentType(com.yahoo.searchdefinition.document.SDDocumentType) Search(com.yahoo.searchdefinition.Search) TemporarySDField(com.yahoo.searchdefinition.document.TemporarySDField) VsmfieldsConfig(com.yahoo.vespa.config.search.vsm.VsmfieldsConfig) Test(org.junit.Test)

Aggregations

Search (com.yahoo.searchdefinition.Search)1 SDDocumentType (com.yahoo.searchdefinition.document.SDDocumentType)1 SDField (com.yahoo.searchdefinition.document.SDField)1 TemporarySDField (com.yahoo.searchdefinition.document.TemporarySDField)1 VsmfieldsConfig (com.yahoo.vespa.config.search.vsm.VsmfieldsConfig)1 Test (org.junit.Test)1