use of com.yahoo.search.query.profile.ModelObjectMap in project vespa by vespa-engine.
the class Query method init.
private void init(Map<String, String> requestMap, CompiledQueryProfile queryProfile) {
startTime = System.currentTimeMillis();
if (queryProfile != null) {
// Move all request parameters to the query profile just to validate that the parameter settings are legal
Properties queryProfileProperties = new QueryProfileProperties(queryProfile);
properties().chain(queryProfileProperties);
// TODO: Just checking legality rather than actually setting would be faster
// Adds errors to the query for illegal set attempts
setPropertiesFromRequestMap(requestMap, properties());
// Create the full chain
properties().chain(new QueryProperties(this, queryProfile.getRegistry())).chain(new ModelObjectMap()).chain(new RequestContextProperties(requestMap)).chain(queryProfileProperties).chain(new DefaultProperties());
// Pass the values from the query profile which maps through a field in the Query object model
// through the property chain to cause those values to be set in the Query object model
setFieldsFrom(queryProfileProperties, requestMap);
} else {
// bypass these complications if there is no query profile to get values from and validate against
properties().chain(new QueryProperties(this, CompiledQueryProfileRegistry.empty)).chain(new PropertyMap()).chain(new DefaultProperties());
setPropertiesFromRequestMap(requestMap, properties());
}
properties().setParentQuery(this);
traceProperties();
}
Aggregations