A simple demo for TNTSearch full text search engine.
###usage
- install TNTSearch dependence by adding this to the Terminal from the root of the demo folder
composer update
- Import database structure to you database in
search.sql
file - add your database Configuration
start.php
file
$tnt->loadConfig([
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'search',
'username' => 'username',
'password' => 'password',
'storage' => 'C:/xampp/htdocs/tntsearch', // Folder to save indexes into.
'charset' => 'utf8',
'collation' => 'utf8_general_ci'
]);
- To create new index add this code after the
$tnt->loadConfig
in thestart.php
file. And then reload the page in your browser.
$indexer = $tnt->createIndex('articles.index');
$indexer->query('SELECT id, title, article, slug FROM articles;');
//$indexer->setLanguage('german'); // Select language OR disable language $indexer->setLanguage('no');
$indexer->run();
exit();
//you should use this code only once for creating the index file. After that you should delete the code
###you will find the rest of documentation in TNTSearch Readme.md