Wuu Posted September 4, 2011 Report Share Posted September 4, 2011 $packet = (explode(',',$uRead['description'])); $result = mysql_query('select t1.tid,t1.title,t1.description,t2.post from '.$INFO['sql_tbl_prefix'].'topics t1 join '.$INFO['sql_tbl_prefix'].'posts t2 on (t1.tid = t2.topic_id) where t1.forum_id in ('.$uSet['topic_read_forums'].',57) && match(t1.description) against("'. implode('" "',$packet) .'" IN BOOLEAN MODE) ORDER BY t1.tid DESC limit 10;'); Es nekādīgi nevaru iebraukt kā kārtot pēc lielāko vārdu sakritības. 1054: Unknown column 'relevance' in 'order clause' Relevance nestrādā. Quote Link to comment Share on other sites More sharing options...
briedis Posted September 4, 2011 Report Share Posted September 4, 2011 (edited) kas te nav skaidrs? 1054: Unknown column 'relevance' in 'order clause' Vispār jau problēma ir kādā citā kvērijā, jo aprakstīto problēmu neredzu šajā. Edited September 4, 2011 by briedis Quote Link to comment Share on other sites More sharing options...
Wuu Posted September 4, 2011 Author Report Share Posted September 4, 2011 Kad pievienoju ORDER BY relevance tad met šādu ārā. Quote Link to comment Share on other sites More sharing options...
spainis Posted September 4, 2011 Report Share Posted September 4, 2011 (edited) match(t1.description) against("'. implode('" "',$packet) as relevance bet vai vajaga, jo rezultāti tāpat jau ir sakārtoti dilstošā kārtībā Edited September 4, 2011 by spainis Quote Link to comment Share on other sites More sharing options...
briedis Posted September 4, 2011 Report Share Posted September 4, 2011 Kad pievienoju ORDER BY relevance tad met šādu ārā. Nu jā, bet kas tad ir tas relevance? Kolonna? Kolonnas aliass? Quote Link to comment Share on other sites More sharing options...
rATRIJS Posted September 4, 2011 Report Share Posted September 4, 2011 (edited) Komentāros ir piemērs: http://dev.mysql.com...lean.html#c5421 kuru var izmantot lai dabūtu to ko tev vajag... Edited September 4, 2011 by rATRIJS Quote Link to comment Share on other sites More sharing options...
Wuu Posted September 5, 2011 Author Report Share Posted September 5, 2011 (edited) Pārmēģināju tur visu, nu nekādīgi nevar piedabūt lai kārto pēc lielākās saderības. Meklēt meklē, bet ka vajag kārtot tā nekas nestrādā. EDIT: Sanāca, kādā web lapelē atradu gatavu search scriptu un no turienes izkodu. $packet = (explode(",",$uRead['description'])); $result = mysql_query('select t1.tid,t1.title,t1.description,t2.post, MATCH (t1.description) AGAINST ("'. implode('" "',$packet) .'" IN BOOLEAN MODE) AS score from '.$INFO['sql_tbl_prefix'].'topics t1 join '.$INFO['sql_tbl_prefix'].'posts t2 on (t1.tid = t2.topic_id) WHERE MATCH (t1.description) AGAINST ("+'. implode('" "+',$packet) .'" IN BOOLEAN MODE) && t1.forum_id in ('.$uSet['topic_read_forums'].',57) ORDER BY score DESC limit 10;'); Edited September 5, 2011 by Wuu Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.