mentalist Posted April 6, 2009 Share Posted April 6, 2009 Hi, Im having trouble doing a sort using boolean fulltext. Ive read that the boolean version doesnt sort, but some comments say you can. Ive done other versions but boolean is only one which returns all results, just not ordered. $s = "SELECT *, MATCH(title,info) AGAINST ('".$searchy."') AS score FROM test_search WHERE MATCH(title,info) AGAINST ('".$searchy."' IN BOOLEAN MODE) ORDER BY score DESC"; Is this the way to go, say maybe running a sort after, or is there a better way to do a search with relevance sorting? Quote Link to comment https://forums.phpfreaks.com/topic/152887-fulltext-sorting/ Share on other sites More sharing options...
fenway Posted April 7, 2009 Share Posted April 7, 2009 Huh? Quote Link to comment https://forums.phpfreaks.com/topic/152887-fulltext-sorting/#findComment-803953 Share on other sites More sharing options...
mentalist Posted April 7, 2009 Author Share Posted April 7, 2009 ok, $s = "SELECT *, MATCH(title,info) AGAINST ('fish') AS score FROM test_search WHERE MATCH(title,info) AGAINST ('fish' IN BOOLEAN MODE) ORDER BY score DESC"; The sample data was the first four pages from a google search using the term 'fish'. I messed up the order but all had different match counts of the word 'fish' but between 11 and 16 times. The boolean results returned all in no particular order other than there chronological entry in the db. The natural language variation only returned two of the examples, also the one with fewer matches was also scored higher. At first I was I was in agreement with your 'huh' comment, as in it doesn't make much sense. It looks good good, but in reality neither use nor ornament, without using external packages. But then i'm not sure if that's what your inferring! Quote Link to comment https://forums.phpfreaks.com/topic/152887-fulltext-sorting/#findComment-803967 Share on other sites More sharing options...
fenway Posted April 14, 2009 Share Posted April 14, 2009 Why are you using different variants here --- one for the match and one for the score? Quote Link to comment https://forums.phpfreaks.com/topic/152887-fulltext-sorting/#findComment-809660 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.