private void setRankFeature(Query query, String key, Object value) {
        if (value instanceof Tensor) {
            query.getRanking().getFeatures().put(key, (Tensor) value);
        }
        else if (value instanceof Double) {
            query.getRanking().getFeatures().put(key, (Double) value);
        }
        else {
            String valueString = asString(value, "");
            try {
                query.getRanking().getFeatures().put(key, Double.parseDouble(valueString));
            }
            catch (IllegalArgumentException e) {
                query.getRanking().getFeatures().put(key, valueString);
            }
        }
    }
Maps between the query model and text properties.
This can be done simpler by using reflection but the performance penalty was not worth it,
especially since we should be conservative in adding things to the query model.

@author bratseth
container-search/src/main/java/com/yahoo/search/query/properties/QueryProperties.java