Search in sources :

Example 1 with SearchRendererAdaptor

use of com.yahoo.prelude.templates.SearchRendererAdaptor in project vespa by vespa-engine.

the class RendererRegistry method addTemplateSet.

@SuppressWarnings({ "deprecation", "unchecked" })
private ComponentId addTemplateSet(UserTemplate<?> templateSet) {
    Renderer renderer = new SearchRendererAdaptor(templateSet);
    ComponentId rendererId = new ComponentId(templateSet.getName());
    renderer.initId(rendererId);
    register(rendererId, renderer);
    return rendererId;
}
Also used : SearchRendererAdaptor(com.yahoo.prelude.templates.SearchRendererAdaptor) Renderer(com.yahoo.processing.rendering.Renderer) ComponentId(com.yahoo.component.ComponentId)

Example 2 with SearchRendererAdaptor

use of com.yahoo.prelude.templates.SearchRendererAdaptor in project vespa by vespa-engine.

the class TilingTestCase method callSearchAndSetRenderer.

private Result callSearchAndSetRenderer(Chain<Searcher> chain, Query query) {
    Execution.Context context = new Execution.Context(null, null, null, new RendererRegistry(MoreExecutors.directExecutor()), new SimpleLinguistics());
    Result result = new Execution(chain, context).search(query);
    result.getTemplating().setRenderer(new SearchRendererAdaptor(new TiledTemplateSet()));
    return result;
}
Also used : SimpleLinguistics(com.yahoo.language.simple.SimpleLinguistics) Execution(com.yahoo.search.searchchain.Execution) TiledTemplateSet(com.yahoo.prelude.templates.TiledTemplateSet) SearchRendererAdaptor(com.yahoo.prelude.templates.SearchRendererAdaptor) RendererRegistry(com.yahoo.search.rendering.RendererRegistry) Result(com.yahoo.search.Result)

Aggregations

SearchRendererAdaptor (com.yahoo.prelude.templates.SearchRendererAdaptor)2 ComponentId (com.yahoo.component.ComponentId)1 SimpleLinguistics (com.yahoo.language.simple.SimpleLinguistics)1 TiledTemplateSet (com.yahoo.prelude.templates.TiledTemplateSet)1 Renderer (com.yahoo.processing.rendering.Renderer)1 Result (com.yahoo.search.Result)1 RendererRegistry (com.yahoo.search.rendering.RendererRegistry)1 Execution (com.yahoo.search.searchchain.Execution)1