I need execute 2 queries by one queue and passing result of first query to IF expression of other query as well as ordinary MySQL queries.
As example, I try pass @average variable into second query:
SET @average=(SELECT AVG(weight()) avg_rank FROM common WHERE match('query text') OPTION ranker=expr('sum(word_count)*100 + sum(lcs*user_weight)*100 + bm25 + sum(exact_order)*200');
SELECT *, weight() as rank, 2000 * exp( - 9.594E-5 * abs(1486121357 - _rank_date)/1000) AS date_rank, IF(_importance > @average,_importance,0) AS importance_rank, (rank + date_rank + importance_rank) as total_rank FROM common WHERE match('query text') OPTION ranker=expr('sum(word_count)*100 + sum(lcs*user_weight)*100 + bm25 + sum(exact_order)*200')
But i had parse error. How i can do it?