summaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo/searchdefinition/UnprocessingSearchBuilder.java
blob: b448005c6a594cd5f772316caaaeba9b4c6f2c2e (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.searchdefinition;

import com.yahoo.searchdefinition.parser.ParseException;
import com.yahoo.config.application.api.ApplicationPackage;
import com.yahoo.config.application.api.DeployLogger;
import com.yahoo.vespa.model.container.search.QueryProfiles;

import java.io.IOException;

/**
 * A SearchBuilder that does not run the processing chain for searches
 */
public class UnprocessingSearchBuilder extends SearchBuilder {

    public UnprocessingSearchBuilder(ApplicationPackage app, RankProfileRegistry rankProfileRegistry) {
        super(app, rankProfileRegistry);
    }

    public UnprocessingSearchBuilder() {
        super();
    }

    public UnprocessingSearchBuilder(RankProfileRegistry rankProfileRegistry) {
        super(rankProfileRegistry);
    }

    @Override
    public void process(Search search, DeployLogger deployLogger, QueryProfiles queryProfiles) {
        // empty
    }

    public static Search buildUnprocessedFromFile(String fileName) throws IOException, ParseException {
        SearchBuilder builder = new UnprocessingSearchBuilder();
        builder.importFile(fileName);
        builder.build();
        return builder.getSearch();
    }
}