Search in sources :

Example 1 with NumericDataType

use of com.yahoo.document.NumericDataType in project vespa by vespa-engine.

the class IntegerIndex2Attribute method process.

@Override
public void process(boolean validate) {
    for (SDField field : search.allConcreteFields()) {
        if (field.doesIndexing() && field.getDataType().getPrimitiveType() instanceof NumericDataType) {
            if (field.getIndex(field.getName()) != null && !(field.getIndex(field.getName()).getType().equals(Index.Type.VESPA)))
                continue;
            ScriptExpression script = field.getIndexingScript();
            Set<String> attributeNames = new HashSet<>();
            new MyVisitor(attributeNames).visit(script);
            field.setIndexingScript((ScriptExpression) new MyConverter(attributeNames).convert(script));
            warn(search, field, "Changed to attribute because numerical indexes (field has type " + field.getDataType().getName() + ") is not currently supported." + " Index-only settings may fail. Ignore this warning for streaming search.");
        }
    }
}
Also used : SDField(com.yahoo.searchdefinition.document.SDField) NumericDataType(com.yahoo.document.NumericDataType) ScriptExpression(com.yahoo.vespa.indexinglanguage.expressions.ScriptExpression) HashSet(java.util.HashSet)

Aggregations

NumericDataType (com.yahoo.document.NumericDataType)1 SDField (com.yahoo.searchdefinition.document.SDField)1 ScriptExpression (com.yahoo.vespa.indexinglanguage.expressions.ScriptExpression)1 HashSet (java.util.HashSet)1