summaryrefslogtreecommitdiffstats
path: root/container-search/src/test/java/com/yahoo/search/searchchain/config/test/updatesearcher/UpdateSearcher.java
blob: 92bc09c01629d68feaa7a4a4c0e9330b4cd04f9c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.searchchain.config.test.updatesearcher;

import com.yahoo.search.Query;
import com.yahoo.search.Result;
import com.yahoo.search.result.Hit;
import com.yahoo.search.searchchain.Execution;

/**
 * @author bratseth
 */
public class UpdateSearcher extends com.yahoo.search.Searcher {

    public String test = "update";

    @Override
    public Result search(Query query,Execution execution) {
        Result result=execution.search(query);
        if (result==null)
            result=new Result(query);
        result.hits().add(new Hit("from:updatesearcher:0"));
        return result;
    }
}