use of com.yahoo.search.query.profile.types.FieldDescription in project vespa by vespa-engine.
the class QueryProfileTypeTestCase method setUp.
@Override
protected void setUp() {
registry = new QueryProfileRegistry();
type = new QueryProfileType(new ComponentId("testtype"));
type.inherited().add(registry.getTypeRegistry().getComponent(new ComponentId("native")));
typeStrict = new QueryProfileType(new ComponentId("testtypeStrict"));
typeStrict.setStrict(true);
user = new QueryProfileType(new ComponentId("user"));
userStrict = new QueryProfileType(new ComponentId("userStrict"));
userStrict.setStrict(true);
registry.getTypeRegistry().register(type);
registry.getTypeRegistry().register(typeStrict);
registry.getTypeRegistry().register(user);
registry.getTypeRegistry().register(userStrict);
addTypeFields(type, registry.getTypeRegistry());
type.addField(new FieldDescription("myUserQueryProfile", FieldType.fromString("query-profile:user", registry.getTypeRegistry())));
addTypeFields(typeStrict, registry.getTypeRegistry());
typeStrict.addField(new FieldDescription("myUserQueryProfile", FieldType.fromString("query-profile:userStrict", registry.getTypeRegistry())));
addUserFields(user, registry.getTypeRegistry());
addUserFields(userStrict, registry.getTypeRegistry());
}
use of com.yahoo.search.query.profile.types.FieldDescription in project vespa by vespa-engine.
the class QueryProfileTypeTestCase method addTypeFields.
private void addTypeFields(QueryProfileType type, QueryProfileTypeRegistry registry) {
type.addField(new FieldDescription("myString", FieldType.fromString("string", registry)), registry);
type.addField(new FieldDescription("myInteger", FieldType.fromString("integer", registry), "int"), registry);
type.addField(new FieldDescription("myLong", FieldType.fromString("long", registry)), registry);
type.addField(new FieldDescription("myFloat", FieldType.fromString("float", registry)), registry);
type.addField(new FieldDescription("myDouble", FieldType.fromString("double", registry)), registry);
type.addField(new FieldDescription("myBoolean", FieldType.fromString("boolean", registry)), registry);
type.addField(new FieldDescription("myBoolean", FieldType.fromString("boolean", registry)), registry);
type.addField(new FieldDescription("ranking.features.query(myTensor1)", FieldType.fromString("tensor(a{},b{})", registry)), registry);
type.addField(new FieldDescription("ranking.features.query(myTensor2)", FieldType.fromString("tensor(x[2],y[2])", registry)), registry);
type.addField(new FieldDescription("ranking.features.query(myTensor3)", FieldType.fromString("tensor(x{})", registry)), registry);
type.addField(new FieldDescription("myQuery", FieldType.fromString("query", registry)), registry);
type.addField(new FieldDescription("myQueryProfile", FieldType.fromString("query-profile", registry), "qp"), registry);
}
Aggregations