aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/test/examples/largerankingexpressions/rankexpression.sd
blob: a33238e15b5b4ef2fd0c185348741a58640fc786 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
search rankexpression {

  document rankexpression {

    field artist type string {
      indexing: summary | index
    }

    field title type string {
      indexing: summary | index
    }

    field surl type string {
      indexing: summary
    }

    field year type int {
      indexing: summary | attribute
    }

  }

  rank-profile base {

    function large_f() {
      expression: 78+closeness(distance)*(attribute(year)+attribute(year))/attribute(year)
    }
    macro large_m() {
      expression: 78+closeness(distance)*(attribute(year)+attribute(year))/attribute(year)
    }
  }

  rank-profile child_a inherits base {

    function large_local_f() {
      expression: large_f() + large_m()
    }

    function large_local_m() {
      expression: large_f() + large_m()
    }

    first-phase {
      expression: 0.8+0.2*large_local_f() + large_local_m()
    }
  }

  rank-profile child_b inherits base {

    function large_local_f() {
      expression: large_f() + large_m()
    }

    function large_local_m() {
      expression: large_f() + large_m()
    }

    first-phase {
      expression: 0.8+0.2*large_local_f() + large_local_m()
    }
  }

}