forked from LBRYCommunity/lbry-sdk
make app backward compatible with trending_score
-update trending decay function to zero out low trending score values faster
This commit is contained in:
parent
a51bf6a4fa
commit
3800fb1ab0
2 changed files with 2 additions and 1 deletions
|
@ -73,6 +73,7 @@ RANGE_FIELDS = {
|
|||
ALL_FIELDS = RANGE_FIELDS | TEXT_FIELDS | FIELDS
|
||||
|
||||
REPLACEMENTS = {
|
||||
'trending_mixed': 'trending_score'
|
||||
# 'name': 'normalized_name',
|
||||
'txid': 'tx_id',
|
||||
'nout': 'tx_nout',
|
||||
|
|
|
@ -183,7 +183,7 @@ class SearchIndex:
|
|||
decay_factor = 2 * (2.0 ** (-1 / self._trending_half_life))
|
||||
decay_script = """
|
||||
if (ctx._source.trending_score == null) { ctx._source.trending_score = 0.0; }
|
||||
if ((-0.000001 <= ctx._source.trending_score) && (ctx._source.trending_score <= 0.000001)) {
|
||||
if ((-0.1 <= ctx._source.trending_score) && (ctx._source.trending_score <= 0.1)) {
|
||||
ctx._source.trending_score = 0.0;
|
||||
} else if (ctx._source.effective_amount >= %s) {
|
||||
ctx._source.trending_score *= %s;
|
||||
|
|
Loading…
Reference in a new issue