Метод | Описание | |
---|---|---|
__construct ( ) | Placeholder method | |
bulk_index_posts ( $body ) : array | object | WP_Error | Decode the bulk index response | |
create_network_alias ( array $indexes ) : array | boolean | Create the network alias from an array of indexes | |
delete_index ( string $index_name = null ) : array | boolean | Delete the current index or delete the index passed by name | |
delete_network_alias ( ) : boolean | array | Delete the network index alias | |
delete_post ( integer $post_id, boolean $blocking = true ) : boolean | Delete a post from the ES server given a site ID and a host site ID which is used to determine the index to delete from. | |
elasticpress_enabled ( $query ) : boolean | Check to see if we should allow elasticpress to override this query | |
elasticsearch_can_connect ( ) : boolean | This function checks if we can connect to Elasticsearch | |
factory ( ) : EP_API | Return singleton instance of class | |
format_args ( array $args ) : array | Format WP query args for ES | |
format_request_headers ( ) : array | Add appropriate request headers | |
get_cluster_status ( ) : array | Get cluster status | |
get_elasticsearch_version ( ) : string | Get Elasticsearch version | |
get_index_status ( integer $blog_id = null ) : array | Get index status | |
get_plugins ( ) : array | Get Elasticsearch plugins | |
get_post ( integer $post_id ) : boolean | Get a post from the index | |
get_query_log ( ) : array | Return queries for debugging | |
get_search_status ( integer $blog_id = null ) : array | Retrieves search stats from Elasticsearch. | |
get_sites ( integer $limit ) : mixed | void | Wrapper function for get_sites - allows us to have one central place for the ep_indexable_sites filter | |
index_exists ( null $index_name = null ) : boolean | Checks if index exists by index name, returns true or false | |
index_post ( array $post, boolean $blocking = true ) : array | boolean | mixed | Index a post under a given site index or the global index ($site_id = 0) | |
is_empty_query ( array $response ) : boolean | Check if a response array contains results or not | |
parse_api_response ( object $response ) : array | Parse response from Elasticsearch | |
parse_site_id ( string $index_name ) : integer | Pull the site id from the index name | |
prepare_meta ( object $post ) : array | Prepare post meta to send to ES | |
prepare_meta_types ( array $post_meta ) : array | Prepare post meta type values to send to ES | |
prepare_meta_value_types ( mixed $meta_value ) : array | Prepare meta types for meta value | |
prepare_post ( integer $post_id ) : boolean | array | Prepare a post for syncing | |
put_mapping ( ) : array | boolean | mixed | Send mapping to ES | |
query ( array $args, array $query_args, string $scope = 'current' ) : array | Search for posts under a specific site index or the global index ($site_id = 0). | |
refresh_index ( ) : boolean | Refresh the current index | |
remote_request ( string $path, array $args = [], array $query_args = [] ) : WP_Error | array | Wrapper for wp_remote_request |
Метод | Описание | |
---|---|---|
_add_query_log ( array $query ) : void | Query logging. Don't log anything to the queries property when WP_DEBUG is not enabled. Calls action 'ep_add_query_log' if you want to access the query outside of the ElasticPress plugin. This runs regardless of debufg settings. | |
parse_order ( string $order ) : string | Parse an 'order' query variable and cast it to ASC or DESC as necessary. | |
parse_orderby ( string $orderbys, $default_order, array $args ) : array | Convert the alias to a properly-prefixed sort value. | |
sanitize_taxonomy_names ( $taxonomies ) : array | WP is using 'weird' taxonomy name, for example: 'category' but in query using 'category_name', 'post_tag' but in queries using 'tag' Map taxonomy name in db to taxonomy in query |
Метод | Описание | |
---|---|---|
get_parent_terms ( $terms, $term, $tax_name ) : array | Recursively get all the ancestor terms of the given term | |
prepare_date_terms ( $post_date_gmt ) : array | Prepare date terms to send to ES. | |
prepare_terms ( object $post ) : array | Prepare terms to send to ES. |
protected _add_query_log ( array $query ) : void | ||
$query | array | Query. |
Результат | void | Method does not return. |
public bulk_index_posts ( $body ) : array | object | WP_Error | ||
$body | ||
Результат | array | object | WP_Error |
public delete_network_alias ( ) : boolean | array | ||
Результат | boolean | array |
public elasticpress_enabled ( $query ) : boolean | ||
$query | ||
Результат | boolean |
public elasticsearch_can_connect ( ) : boolean | ||
Результат | boolean |
public static factory ( ) : EP_API | ||
Результат | EP_API |
public format_args ( array $args ) : array | ||
$args | array | |
Результат | array |
public format_request_headers ( ) : array | ||
Результат | array |
public get_cluster_status ( ) : array | ||
Результат | array | Contains the status message or the returned statistics. |
public get_elasticsearch_version ( ) : string | ||
Результат | string |
public get_index_status ( integer $blog_id = null ) : array | ||
$blog_id | integer | Id of blog to get stats. |
Результат | array | Contains the status message or the returned statistics. |
public get_plugins ( ) : array | ||
Результат | array | Array of plugins and their version or error message |
public get_query_log ( ) : array | ||
Результат | array |
public get_search_status ( integer $blog_id = null ) : array | ||
$blog_id | integer | Id of blog to get stats. |
Результат | array | Contains the status message or the returned statistics. |
public index_exists ( null $index_name = null ) : boolean | ||
$index_name | null | |
Результат | boolean |
public is_empty_query ( array $response ) : boolean | ||
$response | array | |
Результат | boolean |
public parse_api_response ( object $response ) : array | ||
$response | object | JSON decoded response from Elasticsearch. |
Результат | array | Contains the status message or the returned statistics. |
protected parse_order ( string $order ) : string | ||
$order | string | The 'order' query variable. |
Результат | string | The sanitized 'order' query variable. |
public parse_site_id ( string $index_name ) : integer | ||
$index_name | string | |
Результат | integer |
public prepare_meta ( object $post ) : array | ||
$post | object | |
Результат | array |
public prepare_meta_types ( array $post_meta ) : array | ||
$post_meta | array | |
Результат | array |
public prepare_meta_value_types ( mixed $meta_value ) : array | ||
$meta_value | mixed | |
Результат | array |
public refresh_index ( ) : boolean | ||
Результат | boolean |
public remote_request ( string $path, array $args = [], array $query_args = [] ) : WP_Error | array | ||
$path | string | Site URL to retrieve. |
$args | array | Optional. Request arguments. Default empty array. |
$query_args | array | Optional. The query args originally passed to WP_Query |
Результат | WP_Error | array | The response or WP_Error on failure. |
protected sanitize_taxonomy_names ( $taxonomies ) : array | ||
$taxonomies | ||
Результат | array |