PHP 클래스 TextAnalysis\Engines\InvertedIndexEngine

저자: yooper
파일 보기 프로젝트 열기: yooper/php-text-analysis

보호된 프로퍼티들

프로퍼티 타입 설명
$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