Skip to content
This repository has been archived by the owner on Apr 15, 2022. It is now read-only.

the94air/TNT-search-demo

Repository files navigation

TNT-search-demo

A simple demo for TNTSearch full text search engine.


###usage

  1. install TNTSearch dependence by adding this to the Terminal from the root of the demo folder
composer update
  1. Import database structure to you database in search.sql file
  2. 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'
]);
  1. To create new index add this code after the $tnt->loadConfig in the start.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

About

example for using TNT in a simple queries

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published