Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
LangMultipliers = map[string]float64{
"Norsk (bokmål)": 1.5,
"Norsk (nynorsk)": 1.5,
"Norsk": 1.5,
"Engelsk": 1.4,
"Svensk": 1.3,
"Dansk": 1.3,
"Nordsamisk": 1.2,
"Tysk": 1.2,
"Fransk": 1.2,
"Sørsamisk": 1.1,
"Lulesamisk": 1.1,
"Spansk": 1.1,
"Italiensk": 1.1,
}
)
Functions ¶
This section is empty.
Types ¶
type ScoreScriptParams ¶
type ScoreScriptParams struct { AgeGain float64 // justeringsfaktor for hvor mye ferskhet har å si AgeScale float64 // antall dager ferskhetsfaktor spenner over (før den blir 1.0 og ikke har noen effekt) ItemsGain float64 // justeringsfaktor for hvor mye antall eksemplarer har å si Now int64 // sekunder siden epoch }
func Get ¶
func Get(isMatchAll bool, scoreByMediaType bool, urlParams url.Values) (scoreFunc *elastic.ScriptFunction, scriptParams ScoreScriptParams)
Choose a scoring function based on whether it's a match all query (stjernesøk) or not. Favors books in certain languages (Norwegian > English > Swedish > ...) over other media types regardless, and if it's a match all query it will also favor newer publications over older ones.
Click to show internal directories.
Click to hide internal directories.