Search in sources :

Example 21 with FieldDescription

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());
}
Also used : QueryProfileRegistry(com.yahoo.search.query.profile.QueryProfileRegistry) CompiledQueryProfileRegistry(com.yahoo.search.query.profile.compiled.CompiledQueryProfileRegistry) QueryProfileType(com.yahoo.search.query.profile.types.QueryProfileType) ComponentId(com.yahoo.component.ComponentId) FieldDescription(com.yahoo.search.query.profile.types.FieldDescription)

Example 22 with FieldDescription

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);
}
Also used : FieldDescription(com.yahoo.search.query.profile.types.FieldDescription)

Aggregations

FieldDescription (com.yahoo.search.query.profile.types.FieldDescription)22 QueryProfileType (com.yahoo.search.query.profile.types.QueryProfileType)11 QueryProfileRegistry (com.yahoo.search.query.profile.QueryProfileRegistry)7 QueryProfile (com.yahoo.search.query.profile.QueryProfile)5 QueryProfileTypeRegistry (com.yahoo.search.query.profile.types.QueryProfileTypeRegistry)5 ComponentId (com.yahoo.component.ComponentId)4 CompiledQueryProfileRegistry (com.yahoo.search.query.profile.compiled.CompiledQueryProfileRegistry)3 CompoundName (com.yahoo.processing.request.CompoundName)2 CompiledQueryProfile (com.yahoo.search.query.profile.compiled.CompiledQueryProfile)2 FieldType (com.yahoo.search.query.profile.types.FieldType)2 HashMap (java.util.HashMap)2 Test (org.junit.Test)2 HttpRequest (com.yahoo.container.jdisc.HttpRequest)1 Query (com.yahoo.search.Query)1 QueryProfileConfigurer (com.yahoo.search.query.profile.config.QueryProfileConfigurer)1 QueryProfileXMLReader (com.yahoo.search.query.profile.config.QueryProfileXMLReader)1 QueryProfilesConfig (com.yahoo.search.query.profile.config.QueryProfilesConfig)1 QueryProfileFieldType (com.yahoo.search.query.profile.types.QueryProfileFieldType)1 Reference (com.yahoo.searchlib.rankingexpression.Reference)1 TensorType (com.yahoo.tensor.TensorType)1