aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/test/examples/rankpropvars.sd
blob: 40f9e73f35afe0259f8bb27a76a34306d1f31fbe (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
# Copyright 2017 Yahoo Holdings. 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
      body
    }

    field artist type string {
      ## index-to: a
      indexing: index | summary
      body
    }

    field year type int {
      indexing: attribute | summary
      ## index-to: y
      body
    }

    field url type uri {
      body
    }

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

}