use votes in es queries
This commit is contained in:
parent
ba5c40d165
commit
6d2b88fa7b
@ -14,7 +14,7 @@ const STOP_WORDS = ['a', 'an', 'and', 'are', 'as', 'at', 'be', 'but',
|
|||||||
'levels', 'from', 'cryptocurrencies', 'confirmed', 'news', 'network',
|
'levels', 'from', 'cryptocurrencies', 'confirmed', 'news', 'network',
|
||||||
'about', 'sources', 'vote', 'considerations', 'hope',
|
'about', 'sources', 'vote', 'considerations', 'hope',
|
||||||
'keep', 'keeps', 'including', 'we', 'brings', "don't", 'do',
|
'keep', 'keeps', 'including', 'we', 'brings', "don't", 'do',
|
||||||
'interesting', 'us']
|
'interesting', 'us', 'welcome']
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
Query: {
|
Query: {
|
||||||
@ -140,7 +140,7 @@ export default {
|
|||||||
sortArr.push({ sats: 'desc' })
|
sortArr.push({ sats: 'desc' })
|
||||||
break
|
break
|
||||||
case 'votes':
|
case 'votes':
|
||||||
sortArr.push({ upvotes: 'desc' })
|
sortArr.push({ wvotes: 'desc' })
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
@ -156,7 +156,7 @@ export default {
|
|||||||
multi_match: {
|
multi_match: {
|
||||||
query,
|
query,
|
||||||
type: 'most_fields',
|
type: 'most_fields',
|
||||||
fields: ['title^20', 'text'],
|
fields: ['title^100', 'text'],
|
||||||
minimum_should_match: '100%',
|
minimum_should_match: '100%',
|
||||||
boost: 400
|
boost: 400
|
||||||
}
|
}
|
||||||
@ -166,7 +166,7 @@ export default {
|
|||||||
multi_match: {
|
multi_match: {
|
||||||
query,
|
query,
|
||||||
type: 'most_fields',
|
type: 'most_fields',
|
||||||
fields: ['title^20', 'text'],
|
fields: ['title^100', 'text'],
|
||||||
fuzziness: 'AUTO',
|
fuzziness: 'AUTO',
|
||||||
prefix_length: 3,
|
prefix_length: 3,
|
||||||
minimum_should_match: '100%',
|
minimum_should_match: '100%',
|
||||||
@ -178,7 +178,7 @@ export default {
|
|||||||
multi_match: {
|
multi_match: {
|
||||||
query,
|
query,
|
||||||
type: 'most_fields',
|
type: 'most_fields',
|
||||||
fields: ['title^20', 'text'],
|
fields: ['title^100', 'text'],
|
||||||
fuzziness: 'AUTO',
|
fuzziness: 'AUTO',
|
||||||
prefix_length: 3,
|
prefix_length: 3,
|
||||||
minimum_should_match: sortArr.length > 1 ? '100%' : '60%'
|
minimum_should_match: sortArr.length > 1 ? '100%' : '60%'
|
||||||
@ -239,15 +239,18 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
filter: {
|
filter: [
|
||||||
range: {
|
{
|
||||||
|
range:
|
||||||
|
{
|
||||||
createdAt: {
|
createdAt: {
|
||||||
lte: decodedCursor.time,
|
lte: decodedCursor.time,
|
||||||
gte: whenGte
|
gte: whenGte
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
wvotes: { gt: -1 * ITEM_FILTER_THRESHOLD }
|
{ range: { wvotes: { gt: -1 * ITEM_FILTER_THRESHOLD } } }
|
||||||
}
|
]
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
sort: sortArr,
|
sort: sortArr,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user