PHP Class TeamTNT\TNTSearch\TNTSearch

显示文件 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_oe property

public $asYouType

$config public_oe property

public $config

$dbh protected_oe property

protected $dbh

$fuzziness public_oe property

public $fuzziness

$fuzzy_distance public_oe property

public $fuzzy_distance

$fuzzy_max_expansions public_oe property

public $fuzzy_max_expansions

$fuzzy_prefix_length public_oe property

public $fuzzy_prefix_length

$index public_oe property

public $index

$maxDocs public_oe property

public $maxDocs

$stemmer public_oe property

public $stemmer

$tokenizer public_oe property

public $tokenizer