aboutsummaryrefslogtreecommitdiffstats
path: root/integration/intellij/src/test/applications/rankprofilemodularity/test.sd
blob: 763c0bc31a32dfe4c7229190badf43d4ef13704c (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
schema test {

    document test {

        field title type string {
            indexing: index
        }

        field myTensor type tensor(x{}) {
        }

    }

    rank-profile default inherits outside_schema2 {
    }

    rank-profile in_schema0 inherits outside_schema2 {
    }

    rank-profile in_schema1 {

        first-phase {
            expression: nativeRank
        }

        function tensorFunction(tensor1, tensor2, tensor3, tensor4, tensor) {
            expression {
                tensor1{key} +
                tensor2[1] +
                tensor3{key:key1,x:1} +
                tensor4{key:key1,x:(3-2)} +
                tensor1{"key"} +
                tensor3{key:"key1",x:1} +
                tensor(x{}):{x1:3, x2:4} +
                tensor(x{}):{x1:t1[1], x2:t1[0]} +
                tensor(x{},y[2]):{{x:x1, y:0}:3, {x:x2, y:1}:4}
            }
        }

    }

    # A comment
    rank-profile in_schema2 inherits outside_schema2 {

        first-phase {
            expression: f2 + ff1
        }

        macro f2() { # legacy name
            expression: fieldMatch(title) + fo2 + ff1
        }

        function ff1() {
            expression: random
        }

    }

    rank-profile in_schema3 inherits outside_schema1, outside_schema2 {

        function f2() {
            expression: fieldMatch(title) + fo2
        }

        first-phase {
            expression: f2 + fo2
        }

    }

    rank-profile in_schema4 {

        function f2() {
            expression: fieldMatch(title)
        }

        first-phase {
            expression: f2
        }

    }

}