PHP Class Wallmander\ElasticsearchIndexer\Model\Indexer

Author: Mikael Mattsson ([email protected])
Inheritance: extends Client
显示文件 Open project: wallmanderco/elasticsearch-indexer Class Usage Examples

Public Methods

Method Description
deletePost ( integer $postsID ) Delete post index.
getIndexablePostStati ( ) : array
getIndexablePostTypes ( ) : array
getSearchablePostTypes ( ) : array
indexPost ( integer | object $post ) : array | boolean
indexPosts ( array $posts )
prepareMeta ( $post ) : array
prepareMetaNum ( array $meta ) : array
preparePost ( $post ) : object
reindex ( integer $site, integer $from, integer $size ) : array Called in admin to reindex all posts in all blogs.
setRefreshInterval ( string $interval = '1s' ) Set refresh_interval on all indexes.
updatePost ( integer $postsID, $data ) Update post index.

Protected Methods

Method Description
flush ( ) Delete existing index, create new index and add mappings.
prepareDateTerms ( $post_date_gmt ) : array
prepareTerms ( $post ) : array
reindexBlog ( integer $offset, integer $postsPerPage = 500 ) : array Reindex all posts in current blog.

Method Details

deletePost() public method

Delete post index.
public deletePost ( integer $postsID )
$postsID integer

flush() protected method

Delete existing index, create new index and add mappings.
protected flush ( )

getIndexablePostStati() public static method

public static getIndexablePostStati ( ) : array
return array

getIndexablePostTypes() public static method

public static getIndexablePostTypes ( ) : array
return array

getSearchablePostTypes() public static method

public static getSearchablePostTypes ( ) : array
return array

indexPost() public method

public indexPost ( integer | object $post ) : array | boolean
$post integer | object
return array | boolean

indexPosts() public method

public indexPosts ( array $posts )
$posts array

prepareDateTerms() protected static method

Author: 10up/ElasticPress
protected static prepareDateTerms ( $post_date_gmt ) : array
$post_date_gmt
return array

prepareMeta() public static method

public static prepareMeta ( $post ) : array
$post
return array

prepareMetaNum() public static method

public static prepareMetaNum ( array $meta ) : array
$meta array
return array

preparePost() public static method

Author: 10up/ElasticPress
public static preparePost ( $post ) : object
$post
return object

prepareTerms() protected static method

protected static prepareTerms ( $post ) : array
$post
return array

reindex() public method

Called in admin to reindex all posts in all blogs.
public reindex ( integer $site, integer $from, integer $size ) : array
$site integer
$from integer
$size integer
return array

reindexBlog() protected method

Reindex all posts in current blog.
protected reindexBlog ( integer $offset, integer $postsPerPage = 500 ) : array
$offset integer
$postsPerPage integer
return array

setRefreshInterval() public method

Set refresh_interval on all indexes.
public setRefreshInterval ( string $interval = '1s' )
$interval string

updatePost() public method

Update post index.
public updatePost ( integer $postsID, $data )
$postsID integer