Note that there are some explanatory texts on larger screens.

plurals
  1. POmysql and php FULLTEXT search does more, but doesn't do less?
    primarykey
    data
    text
    <p>Listed on this question: <a href="https://stackoverflow.com/questions/6466665/mysql-problem-complete-server-overrun-please-advise">MySQL problem - COMPLETE server overrun! Please advise</a> are all my server details, so I don't have to re-write them here.</p> <p>So I'm having a PHP script which interacts with a mysql DB. 2 days ago, due to many requests from my users, I have switched from clasic "select * from table where column like 'blabla' and column like 'lablab'" to the fulltext search. Indexed, tested, good to go. 2 days on the job, already received a bag of complains.</p> <p>Searches are indeed better, that is if you use full words... :(</p> <p>try searching for "apple" and you find almost the same results.</p> <p>try searching for "apple computer at low prices" and the fulltext search is WAY above any LIKE search</p> <p>try searching for "ple" and you get a full list of results with the classic method... but a big fat "Nothing found" text laying in front of you with the fulltext search...</p> <p>Sorry for making it sound so poetic up to this point... :|</p> <p>Is there any workaround for this? making the fulltext use some freakin' wildcards? like %foo% should bring me ffoork, flfooor etc...</p> <p>And for those of you asking, yeah I don't really know my way around mysql further than syntax, simple expressions and basic functions.</p> <p>Please help me with a code snippet or link to some method of working this out... If possible, i would rather not complicate my existence with some 3rd party mysql search engine but as a last resort...</p> <p>Thank you very much in advance! Cheers!</p> <p>Sorry, I forgot to put my code up:</p> <pre><code>$query="SELECT *, CASE when title like '%".$s."%' then 1 else 0 END as titlematch, CASE when tags like '%".$s."%' then 1 else 0 END as tagsmatch, MATCH (title, tags) AGAINST ('".$s."') AS relevance FROM videos WHERE MATCH(title, tags) AGAINST ('".$s."' IN BOOLEAN MODE) HAVING relevance &gt; 0 ORDER by titlematch desc, tagsmatch desc, relevance desc, `datetime` desc, `views` desc "; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload