PHP Class TextAnalysis\Engines\InvertedIndexEngine

Author: yooper
Afficher le fichier Open project: yooper/php-text-analysis

Protected Properties

Свойство Type Description
$dataDir The directory where all the data and metadata files are stored
$invertedIndex TextAnalysis\Indexes\InvertedIndex
$isDirty tracks if the index or metadata has been altered and requires persisting to the database
$metadata array

Méthodes publiques

Méthode Description
__construct ( $dataDir )
__destruct ( )
addDocument ( TokensDocument $document ) Added a document to the index, default overwrites the existing
getInvertedIndex ( ) : InvertedIndex
getIsDirty ( ) : boolean returns if the index/metadata has been updated since loaded into memory
getMetadata ( ) : array key value array, key is the document id
persist ( ) Persists the data back into the data dir, if it has been changed
query ( string $queryStr ) : array
removeDocument ( TokensDocument $document ) Removes the document from the index

Method Details

__construct() public méthode

public __construct ( $dataDir )

__destruct() public méthode

public __destruct ( )

addDocument() public méthode

Added a document to the index, default overwrites the existing
public addDocument ( TokensDocument $document )
$document TextAnalysis\Documents\TokensDocument

getInvertedIndex() public méthode

public getInvertedIndex ( ) : InvertedIndex
Résultat TextAnalysis\Indexes\InvertedIndex

getIsDirty() public méthode

returns if the index/metadata has been updated since loaded into memory
public getIsDirty ( ) : boolean
Résultat boolean

getMetadata() public méthode

key value array, key is the document id
public getMetadata ( ) : array
Résultat array

persist() public méthode

Persists the data back into the data dir, if it has been changed
public persist ( )

query() public méthode

public query ( string $queryStr ) : array
$queryStr string
Résultat array

removeDocument() public méthode

Removes the document from the index
public removeDocument ( TokensDocument $document )
$document TextAnalysis\Documents\TokensDocument

Property Details

$dataDir protected_oe property

The directory where all the data and metadata files are stored
protected $dataDir

$invertedIndex protected_oe property

protected InvertedIndex,TextAnalysis\Indexes $invertedIndex
Résultat TextAnalysis\Indexes\InvertedIndex

$isDirty protected_oe property

tracks if the index or metadata has been altered and requires persisting to the database
protected $isDirty

$metadata protected_oe property

protected array $metadata
Résultat array