summaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo/searchdefinition/DocumentsOnlyRankProfile.java
blob: 9335c0b400594f8dbee66553b5fa221a6093c369 (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
package com.yahoo.searchdefinition;

import java.util.List;

/**
 * A rank profile which ignores all calls made to it which may fail in a document only setting.
 * This is used by the search definition parser when it is requested to parse documents only,
 * to avoid having to check for this in every method which adds to the rank profile.
 * (And why do we ever want to parse documents only? Because it is used when generating Java classes
 * from documents, where the full application package may not be available.)
 *
 * @author bratseth
 */
public class DocumentsOnlyRankProfile extends RankProfile {

    public DocumentsOnlyRankProfile(String name, Search search, RankProfileRegistry rankProfileRegistry) {
        super(name, search, rankProfileRegistry);
    }

    @Override
    public void setFirstPhaseRanking(String expression) {
        // Ignore
    }

    @Override
    public void setSecondPhaseRanking(String expression) {
        // Ignore
    }

    @Override
    public void addFunction(String name, List<String> arguments, String expression, boolean inline) {
        // Ignore
    }

}