PHP Класс TextAnalysis\Engines\InvertedIndexEngine

Автор: yooper
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$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

Открытые методы

Метод Описание
__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

Описание методов

__construct() публичный Метод

public __construct ( $dataDir )

__destruct() публичный Метод

public __destruct ( )

addDocument() публичный Метод

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

getInvertedIndex() публичный Метод

public getInvertedIndex ( ) : InvertedIndex
Результат TextAnalysis\Indexes\InvertedIndex

getIsDirty() публичный Метод

returns if the index/metadata has been updated since loaded into memory
public getIsDirty ( ) : boolean
Результат boolean

getMetadata() публичный Метод

key value array, key is the document id
public getMetadata ( ) : array
Результат array

persist() публичный Метод

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

query() публичный Метод

public query ( string $queryStr ) : array
$queryStr string
Результат array

removeDocument() публичный Метод

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

Описание свойств

$dataDir защищенное свойство

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

$invertedIndex защищенное свойство

protected InvertedIndex,TextAnalysis\Indexes $invertedIndex
Результат TextAnalysis\Indexes\InvertedIndex

$isDirty защищенное свойство

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

$metadata защищенное свойство

protected array $metadata
Результат array