Overview

Namespaces

  • elasticsearch

Classes

  • Config
  • Defaults
  • Faceting
  • Indexer
  • Searcher
  • Overview
  • Namespace
  • Class
  • Tree

Class Indexer

This class handles the magic of building documents and sending them to ElasticSearch for indexing.

Namespace: elasticsearch
License: http://opensource.org/licenses/MIT
Author: Paris Holley <mail@parisholley.com>
Version: 2.0.0
Located at Indexer.php
Methods summary
public static integer
# per_page( )

The number of posts to index per page when re-indexing

The number of posts to index per page when re-indexing

Returns

integer
posts per page
public static WP_Post[]
# get_posts( integer $page = 1 )

Retrieve the posts for the page provided

Retrieve the posts for the page provided

Parameters

$page
integer
$page The page of results to retrieve for indexing

Returns

WP_Post[]
posts
public static integer
# get_count( )

Retrieve count of the number of posts available for indexing

Retrieve count of the number of posts available for indexing

Returns

integer
number of posts
public static
# clear( )

Removes all data in the ElasticSearch index

Removes all data in the ElasticSearch index

public static
# reindex( integer $page = 1 )

Re-index the posts on the given page in the ElasticSearch index

Re-index the posts on the given page in the ElasticSearch index

Parameters

$page
integer
$page The page to re-index
public static
# delete( WP_Post $post )

Removes a post from the ElasticSearch index

Removes a post from the ElasticSearch index

Parameters

$post
WP_Post
$post The wordpress post to remove
public static
# addOrUpdate( WP_Post $post )

Updates an existing document in the ElasticSearch index (or creates it if it doesn't exist)

Updates an existing document in the ElasticSearch index (or creates it if it doesn't exist)

Parameters

$post
WP_Post
$post The wordpress post to remove
API documentation generated by ApiGen 2.8.0