TNT Studio
1 min readMay 18, 2016

--

Nice tutorial! Since you’re dealing here with documents that have a title and a description, more relevant search would be given with the ->search method instead ->searchBoolean ie.
TNTSearch::search(“search for something”, 12);
After you get the result set it’s important to fetch them in the same order from the database as they were returned from TNTSearch. A raw query looks like:

SELECT * FROM articles WHERE id IN $res ORDER BY FIELD(id, $res);

--

--