use of com.yahoo.search.query.profile.BackedOverridableQueryProfile in project vespa by vespa-engine.
the class QueryProfiles method addField.
private void addField(QueryProfilesConfig.Queryprofile.Builder qpB, QueryProfile profile, Entry<String, Object> field, String namePrefix) {
String fullName = namePrefix + field.getKey();
if (field.getValue() instanceof QueryProfile) {
QueryProfile subProfile = (QueryProfile) field.getValue();
if (!subProfile.isExplicit()) {
// Implicitly defined profile - add content
addFieldChildren(qpB, subProfile, fullName + ".");
} else {
// Reference to an id'ed profile - output reference plus any local overrides
QueryProfilesConfig.Queryprofile.Reference.Builder refB = new QueryProfilesConfig.Queryprofile.Reference.Builder();
createReferenceFieldConfig(refB, profile, fullName, field.getKey(), ((BackedOverridableQueryProfile) subProfile).getBacking().getId().stringValue());
qpB.reference(refB);
addFieldChildren(qpB, subProfile, fullName + ".");
}
} else {
// a primitive
qpB.property(createPropertyFieldConfig(profile, fullName, field.getKey(), field.getValue()));
}
}
use of com.yahoo.search.query.profile.BackedOverridableQueryProfile in project vespa by vespa-engine.
the class QueryProfiles method addVariantField.
private void addVariantField(QueryProfilesConfig.Queryprofile.Queryprofilevariant.Builder qpB, Entry<String, Object> field, String namePrefix) {
String fullName = namePrefix + field.getKey();
if (field.getValue() instanceof QueryProfile) {
QueryProfile subProfile = (QueryProfile) field.getValue();
if (!subProfile.isExplicit()) {
// Implicitly defined profile - add content
addVariantFieldChildren(qpB, subProfile, fullName + ".");
} else {
// Reference to an id'ed profile - output reference plus any local overrides
QueryProfilesConfig.Queryprofile.Queryprofilevariant.Reference.Builder refB = new QueryProfilesConfig.Queryprofile.Queryprofilevariant.Reference.Builder();
createVariantReferenceFieldConfig(refB, fullName, ((BackedOverridableQueryProfile) subProfile).getBacking().getId().stringValue());
qpB.reference(refB);
addVariantFieldChildren(qpB, subProfile, fullName + ".");
}
} else {
// a primitive
qpB.property(createVariantPropertyFieldConfig(fullName, field.getValue()));
}
}
Aggregations