PHP Class TeamTNT\TNTSearch\TNTSearch

Show file Open project: teamtnt/tntsearch Class Usage Examples

Public Properties

Property Type Description
$asYouType
$config
$fuzziness
$fuzzy_distance
$fuzzy_max_expansions
$fuzzy_prefix_length
$index
$maxDocs
$stemmer
$tokenizer

Protected Properties

Property Type Description
$dbh

Public Methods

Method Description
__construct ( )
breakIntoTokens ( $text )
createIndex ( $indexName )
filesystemMapIdsToPaths ( $docs )
fuzzySearch ( $keyword )
getAllDocumentsForKeyword ( $keyword, $noLimit = false, $isLastKeyword = false )
getAllDocumentsForWhereKeywordNot ( $keyword, $noLimit = false )
getIndex ( )
getStemmer ( )
getWordlistByKeyword ( $keyword, $isLastWord = false )
highlight ( $text, $needle, $tag = 'em', $options = [] )
info ( $str )
isFileSystemIndex ( )
loadConfig ( $config )
search ( $phrase, $numOfResults = 100 )
searchBoolean ( $phrase, $numOfResults = 100 )
selectIndex ( $indexName )
setDatabaseHandle ( PDO $dbh )
setStemmer ( )
setTokenizer ( TeamTNT\TNTSearch\Support\TokenizerInterface $tokenizer )
snippet ( $words, $fulltext, $rellength = 300, $prevcount = 50, $indicator = '...' )
totalDocumentsInCollection ( )
totalMatchingDocuments ( $keyword, $isLastWord = false )

Private Methods

Method Description
getAllDocumentsForFuzzyKeyword ( $words, $noLimit )
getAllDocumentsForStrictKeyword ( $word, $noLimit )

Method Details

__construct() public method

public __construct ( )

breakIntoTokens() public method

public breakIntoTokens ( $text )

createIndex() public method

public createIndex ( $indexName )

filesystemMapIdsToPaths() public method

public filesystemMapIdsToPaths ( $docs )

fuzzySearch() public method

public fuzzySearch ( $keyword )

getAllDocumentsForKeyword() public method

public getAllDocumentsForKeyword ( $keyword, $noLimit = false, $isLastKeyword = false )

getAllDocumentsForWhereKeywordNot() public method

public getAllDocumentsForWhereKeywordNot ( $keyword, $noLimit = false )

getIndex() public method

public getIndex ( )

getStemmer() public method

public getStemmer ( )

getWordlistByKeyword() public method

public getWordlistByKeyword ( $keyword, $isLastWord = false )

highlight() public method

public highlight ( $text, $needle, $tag = 'em', $options = [] )

info() public method

public info ( $str )

isFileSystemIndex() public method

public isFileSystemIndex ( )

loadConfig() public method

public loadConfig ( $config )

searchBoolean() public method

public searchBoolean ( $phrase, $numOfResults = 100 )

selectIndex() public method

public selectIndex ( $indexName )

setDatabaseHandle() public method

public setDatabaseHandle ( PDO $dbh )
$dbh PDO

setStemmer() public method

public setStemmer ( )

setTokenizer() public method

public setTokenizer ( TeamTNT\TNTSearch\Support\TokenizerInterface $tokenizer )
$tokenizer TeamTNT\TNTSearch\Support\TokenizerInterface

snippet() public method

public snippet ( $words, $fulltext, $rellength = 300, $prevcount = 50, $indicator = '...' )

totalDocumentsInCollection() public method

totalMatchingDocuments() public method

public totalMatchingDocuments ( $keyword, $isLastWord = false )

Property Details

$asYouType public property

public $asYouType

$config public property

public $config

$dbh protected property

protected $dbh

$fuzziness public property

public $fuzziness

$fuzzy_distance public property

public $fuzzy_distance

$fuzzy_max_expansions public property

public $fuzzy_max_expansions

$fuzzy_prefix_length public property

public $fuzzy_prefix_length

$index public property

public $index

$maxDocs public property

public $maxDocs

$stemmer public property

public $stemmer

$tokenizer public property

public $tokenizer