This repository was archived by the owner on Apr 15, 2022. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork0
the94air/TNT-search-demo
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
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 inTNTSearch Readme.md