use of com.yahoo.searchdefinition.document.SDField in project vespa by vespa-engine.
the class IndexingScriptRewriterTestCase method testDynamicAndStaticSummariesRewritingWithIndexing.
@Test
public void testDynamicAndStaticSummariesRewritingWithIndexing() {
SDField field = createField("test", DataType.STRING, "{ summary | index }");
field.addSummaryField(createDynamicSummaryField(field, "dyn"));
field.addSummaryField(createStaticSummaryField(field, "test"));
field.addSummaryField(createStaticSummaryField(field, "other"));
field.addSummaryField(createDynamicSummaryField(field, "dyn2"));
assertIndexingScript("{ input test | tokenize normalize stem:\"SHORTEST\" | summary dyn | summary dyn2 | summary other | " + "summary test | index test; }", field);
}
use of com.yahoo.searchdefinition.document.SDField in project vespa by vespa-engine.
the class ImplicitStructTypesTestCase method assertField.
private static void assertField(SDDocumentType docType, String fieldName, DataType type) {
// TODO: get rid of this stupidity
Field field = getSecretField(docType, fieldName);
assertNotNull(field);
assertEquals(type, field.getDataType());
assertTrue(field instanceof SDField);
}
use of com.yahoo.searchdefinition.document.SDField in project vespa by vespa-engine.
the class IndexingScriptRewriterTestCase method testMultiblockTokenize.
@Test
public void testMultiblockTokenize() {
SDField field = createField("test", DataType.STRING, "{ input test | tokenize | { summary test; }; }");
assertIndexingScript("{ input test | tokenize | { summary test; }; }", field);
}
use of com.yahoo.searchdefinition.document.SDField in project vespa by vespa-engine.
the class IndexingScriptRewriterTestCase method createField.
private static SDField createField(String name, DataType type, String script) {
SDField field = new SDField(null, name, type);
field.parseIndexingScript(script);
return field;
}
use of com.yahoo.searchdefinition.document.SDField in project vespa by vespa-engine.
the class Search method allConcreteFields.
/**
* Returns a list of all the fields of this search definition, that is all fields in all documents, in the documents
* they inherit, and all extra fields. The caller receives ownership to the list - subsequent changes to it will not
* impact this
*/
public List<SDField> allConcreteFields() {
List<SDField> allFields = new ArrayList<>();
allFields.addAll(extraFieldList());
for (Field field : docType.fieldSet()) {
allFields.add((SDField) field);
}
return allFields;
}
Aggregations