An easy-to-use Library to perform ranked fulltext searches with MYSQLi.
Install via composer:
{
"require": {
"alexschwarz89/EasyMysqliFulltext": "1.0.0"
}
}
Run composer install
.
You will find a example file in examples/index.php to use with the included testdata.sql.
use \Alexschwarz89\EasyMysqliFulltext\Search;
$search = new Search( $mysqliInstance );
$query = new SearchQuery($search);
$query->setTable('testdata')
->setSearchFields('description')
->mustInclude('example');
$search->setSearchQuery( $query );
$search->execute();
$search = Search::createWithMYSQLi('localhost', 'username', 'password', 'dbname');
$query->setTable('testdata')
->setSearchFields('description,title,isbn,author')
->mustInclude('example')
->canInclude('another')
->exclude('again')
->preferWithout('this')
->orderBy('some_field', 'ASC');
Contributing is surely allowed! :-)