Search in sources :

Example 1 with RequestContextProperties

use of com.yahoo.search.query.properties.RequestContextProperties 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();
}
Also used : DefaultProperties(com.yahoo.search.query.properties.DefaultProperties) RequestContextProperties(com.yahoo.search.query.properties.RequestContextProperties) PropertyMap(com.yahoo.search.query.properties.PropertyMap) QueryProperties(com.yahoo.search.query.properties.QueryProperties) QueryProperties(com.yahoo.search.query.properties.QueryProperties) Properties(com.yahoo.search.query.Properties) RequestContextProperties(com.yahoo.search.query.properties.RequestContextProperties) DefaultProperties(com.yahoo.search.query.properties.DefaultProperties) QueryProfileProperties(com.yahoo.search.query.profile.QueryProfileProperties) ModelObjectMap(com.yahoo.search.query.profile.ModelObjectMap) QueryProfileProperties(com.yahoo.search.query.profile.QueryProfileProperties)

Aggregations

Properties (com.yahoo.search.query.Properties)1 ModelObjectMap (com.yahoo.search.query.profile.ModelObjectMap)1 QueryProfileProperties (com.yahoo.search.query.profile.QueryProfileProperties)1 DefaultProperties (com.yahoo.search.query.properties.DefaultProperties)1 PropertyMap (com.yahoo.search.query.properties.PropertyMap)1 QueryProperties (com.yahoo.search.query.properties.QueryProperties)1 RequestContextProperties (com.yahoo.search.query.properties.RequestContextProperties)1