'cts:triple-range-query should consider reference value in score calculation
I have the following cts:triple-range-query:
let $frequency_query := cts:properties-fragment-query(
cts:triple-range-query(
sem:iri("http://star-group.net/skc/0.1/07-30"),
sem:iri("http://star-group.net/skc/0.1/hasFrequency"),
0.0,
">=",
("score-function=linear","slope-factor=1024.0"),
1
)
)
I want to include it as a range query in the score calculation, according to Including a Range or Geospatial Query in Scoring. Somehow I can't configure the slope-factor suche that it works with the interval [0,1]. I want to score values that are closer to 1 with a higher score.
My response includes 45 entries. The top 3 have a (relative) frequency bigger than 0.0 and the others have all 0.0.
- 0.2289156626506024
- 0.3325301204819277
- 0.41445783132530123
- 0
...
- 0
However, the first 3 results have all a score of 16384. I expect the first 3 results to have 3 different scores (descending according the the relative frequency).
Complete Query:
xquery version "1.0-ml";
let $language as xs:string := "lang:en"
let $variant as xs:string := "model_x"
let $search_option := ("score-logtf", "relevance-trace")
let $frequency_query := cts:properties-fragment-query(
cts:triple-range-query(
sem:iri("http://star-group.net/skc/0.1/07-30"),
sem:iri("http://star-group.net/skc/0.1/hasFrequency"),
0.0,
">=",
("score-function=linear","slope-factor=1024.0"),
1
)
)
let $query := cts:and-query((
cts:element-attribute-word-query(
xs:QName("MATERIAL"),
xs:QName("ANKER"), $variant,
(),
0
),
cts:collection-query("project:Y"),
cts:collection-query($language),
cts:boost-query(
cts:collection-query("doctype:MATERIAL"),
$frequency_query
)
)
return cts:search(/, $query, $search_option, 0)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
