SQL: score is not calculated for a match
statement when combined with filter-like statements
#29685
Labels
match
statement when combined with filter-like statements
#29685
Original comment by @astefan:
A query like
SELECT SCORE(), * FROM library WHERE match(author,'dan')
does calculate and output the score of the results, while something likeSELECT SCORE(), * FROM library WHERE match(author,'dan') AND (page_count IS NULL OR page_count > 200)
doesn't.The reason seems to be the query in the first case it's simply creating a
match
while the second one is wrongly wrapping the samematch
query in abool
sfilter
(which is not calculating the score by default). While ok to wrap it in abool
, but maybe not inside afilter
. I think the same outcome can be obtained by usingmust
statements instead offilter
ones only when the scoring is needed (the presence ofSCORE()
anywhere in the query)?The text was updated successfully, but these errors were encountered: