Search in sources :

Example 26 with SummaryField

use of com.yahoo.vespa.documentmodel.SummaryField in project vespa by vespa-engine.

the class ValidateFieldTypes method process.

@Override
public void process(boolean validate) {
    if (!validate)
        return;
    String searchName = search.getName();
    Map<String, DataType> seenFields = new HashMap<>();
    search.allFields().forEach(field -> {
        checkFieldType(searchName, "index field", field.getName(), field.getDataType(), seenFields);
        for (Map.Entry<String, Attribute> entry : field.getAttributes().entrySet()) {
            checkFieldType(searchName, "attribute", entry.getKey(), entry.getValue().getDataType(), seenFields);
        }
    });
    for (DocumentSummary summary : search.getSummaries().values()) {
        for (SummaryField field : summary.getSummaryFields()) {
            checkFieldType(searchName, "summary field", field.getName(), field.getDataType(), seenFields);
        }
    }
}
Also used : SummaryField(com.yahoo.vespa.documentmodel.SummaryField) HashMap(java.util.HashMap) Attribute(com.yahoo.searchdefinition.document.Attribute) TensorDataType(com.yahoo.document.TensorDataType) DataType(com.yahoo.document.DataType) DocumentSummary(com.yahoo.vespa.documentmodel.DocumentSummary) Map(java.util.Map) HashMap(java.util.HashMap)

Aggregations

SummaryField (com.yahoo.vespa.documentmodel.SummaryField)26 DocumentSummary (com.yahoo.vespa.documentmodel.DocumentSummary)10 Attribute (com.yahoo.searchdefinition.document.Attribute)3 SDField (com.yahoo.searchdefinition.document.SDField)3 Index (com.yahoo.searchdefinition.Index)2 Search (com.yahoo.searchdefinition.Search)2 SummaryTransform (com.yahoo.vespa.documentmodel.SummaryTransform)2 HashMap (java.util.HashMap)2 Test (org.junit.Test)2 Pair (com.yahoo.collections.Pair)1 DataType (com.yahoo.document.DataType)1 Field (com.yahoo.document.Field)1 TensorDataType (com.yahoo.document.TensorDataType)1 BooleanIndexDefinition (com.yahoo.searchdefinition.document.BooleanIndexDefinition)1 ImmutableSDField (com.yahoo.searchdefinition.document.ImmutableSDField)1 SDDocumentType (com.yahoo.searchdefinition.document.SDDocumentType)1 Source (com.yahoo.vespa.documentmodel.SummaryField.Source)1 HashSet (java.util.HashSet)1 Map (java.util.Map)1