Strip @ prefix subquery #170

Merged
tiger5226 merged 1 commit from strip_prefex into master 2019-11-20 22:14:05 +01:00
Showing only changes of commit e7c97e8420 - Show all commits

View file

@ -80,6 +80,14 @@ function getResults (input) {
}, },
}, },
}; };
// Try prefix query without an @ if it exists
const channelIdentifier = {
'prefix': {
'name': {
'value': escapedQuery.replace(/^@/gi, ''), 'boost': 50,
},
},
};
const splitName = () => { const splitName = () => {
let queries = []; let queries = [];
@ -253,6 +261,7 @@ function getResults (input) {
conBoost, conBoost,
funcScoreClaimWeight, funcScoreClaimWeight,
funcScoreChannelWeight, funcScoreChannelWeight,
channelIdentifier,
], ],
'must': [ 'must': [
channelSearch, channelSearch,