blob: acab2b96772966e8d24f2151ace9b4cb685149c9 (
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
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
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, Schema schema, RankProfileRegistry rankProfileRegistry,
RankingConstants rankingConstants) {
super(name, schema, rankProfileRegistry, rankingConstants);
}
@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
}
}
|