Search in sources :

Example 1 with JuniperSearcher

use of com.yahoo.prelude.searcher.JuniperSearcher in project vespa by vespa-engine.

the class JuniperSearcherTestCase method createSearchChain.

/**
 * Creates a search chain which always returns a result with one hit containing information given in this
 *
 * @param sdName the search definition type of the returned hit
 * @param content the content of the "dynteaser" field of the returned hit
 */
private Chain<Searcher> createSearchChain(String sdName, String content) {
    JuniperSearcher searcher = new JuniperSearcher(new ComponentId("test"), new QrSearchersConfig(new QrSearchersConfig.Builder()));
    DocumentSourceSearcher docsource = new DocumentSourceSearcher();
    addResult(new Query("?query=12"), sdName, content, docsource);
    addResult(new Query("?query=12&bolding=false"), sdName, content, docsource);
    return new Chain<Searcher>(searcher, docsource);
}
Also used : Chain(com.yahoo.component.chain.Chain) Query(com.yahoo.search.Query) QrSearchersConfig(com.yahoo.container.QrSearchersConfig) JuniperSearcher(com.yahoo.prelude.searcher.JuniperSearcher) DocumentSourceSearcher(com.yahoo.search.searchchain.testutil.DocumentSourceSearcher) ComponentId(com.yahoo.component.ComponentId)

Aggregations

ComponentId (com.yahoo.component.ComponentId)1 Chain (com.yahoo.component.chain.Chain)1 QrSearchersConfig (com.yahoo.container.QrSearchersConfig)1 JuniperSearcher (com.yahoo.prelude.searcher.JuniperSearcher)1 Query (com.yahoo.search.Query)1 DocumentSourceSearcher (com.yahoo.search.searchchain.testutil.DocumentSourceSearcher)1