aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/test/examples/rankpropvars.sd
blob: 339d147dfd00628591051a9a227e96efb2e904b5 (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
# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
search music {
rank-profile other  {

rank-properties {
    $testvar1  :   "foo"
    $testvar_2:"bar"
    $testvarOne23: "baz"
    fieldMatch(title).maxAlternativeSegmentations: 10
    fieldmatch(title).maxOccurrences: 5
    fieldMatch(description).maxOccurrences: 20
}

first-phase {
  expression:nativeRank
}

second-phase {
  expression {
    if (attribute(artist) == query(testvar1),
        0.0 * fieldMatch(title) +  0.0 * attribute(Popularity) + 0.0 * fieldMatch(artist),
        0.0 * attribute(Popularity) + 0.0 * fieldMatch(artist) +  0.0 * fieldMatch(title))
  }
}

}

rank-profile another {
rank-properties {
    $Testvar1  :   "1"
    $Testvar_4:"4"
    $testvarFour23: "234234.234"
    fieldMatch(title).maxAlternativeSegmentations: 45
    fieldmatch(title).maxOccurrences: 56
    fieldMatch(description).maxOccurrences: 23
}

first-phase {
  expression:nativeRank
}

second-phase {
  expression {
    if (attribute(artist) == query(testvar1),  
        0.0 * fieldMatch(title) +  0.0 * attribute(Popularity) + 0.0 * fieldMatch(artist),
        0.0 * attribute(Popularity) + 0.0 * fieldMatch(artist) +  0.0 * fieldMatch(title))
  }
}
}

document music {

    field title type string {
      indexing: index | summary
    }

    field artist type string {
      indexing: index | summary
    }

    field year type int {
      indexing: attribute | summary
    }

    field url type uri {}

    field Popularity type string {
      indexing: attribute | summary
    }
}

}