When conducting SCOREd queries, it should be possible to WEIGHT named fields. Possibly WEIGHT should be a sub-option of SCORE?
// Weight OR queries
QUERY({
SEARCH: [
'make:landrover',
OR: [ 'model:defender', 'model:110', 'model:90' ]
]
}, {
SCORE: {
WEIGHT: {
'model:defender': 0.5, // I'm not that bothered about Defenders
'model:90': 2 // Im all about the 90s
}
}
})
// TODO: weight AND queries
QUERY({
SEARCH: [ 'london', 'manchester' ]
}, {
SCORE: {
WEIGHT: {
'location': 2 // boost docs that have 'london' or 'manchester' in the location field
}
}
})
// TODO: weight AND queries, prefer one token
QUERY({
SEARCH: [ 'london', 'manchester' ]
}, {
SCORE: {
WEIGHT: {
'location:london': 2 // boost docs that have 'london' OVER 'manchester' in the location field
}
}
})
When conducting SCOREd queries, it should be possible to WEIGHT named fields. Possibly WEIGHT should be a sub-option of SCORE?