Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
felipeelia committed Sep 29, 2021
2 parents b64d092 + a234ade commit 0cdd808
Show file tree
Hide file tree
Showing 34 changed files with 2,784 additions and 2,206 deletions.
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,36 @@ All notable changes to this project will be documented in this file, per [the Ke

## [Unreleased]

## [3.6.3] - 2021-09-29

**Note that the upcoming ElasticPress 3.7.0 release will remove built assets from the `develop` branch, will replace `master` with `trunk`, will build a stable release version including built assets into a `stable` branch, and will include a build script should you want to build assets from a branch.** As such, please plan to update any references you have from `master` to either `stable` or `trunk` depending on whether you require built assets or not.

Official PHP support is currently 5.6+. Minimum PHP version for ElasticPress 3.7.0 will be 7.0+.

### Added
- New `ep_facet_widget_term_html` and `ep_facet_widget_term_label` filters to the Facet widget for filtering the HTML and label of individual facet terms. Props [@JakePT](https://github.com/JakePT), [@Rahmon](https://github.com/Rahmon), and [@felipeelia](https://github.com/felipeelia) via [#2363](https://github.com/10up/ElasticPress/pull/2363).
- New `ep_set_sort` filter for changing the `sort` clause of the ES query if `orderby` is not set in WP_Query. Props [@rebeccahum](https://github.com/rebeccahum) and [@felipeelia](https://github.com/felipeelia) via [#2343](https://github.com/10up/ElasticPress/pull/2343) and [#2364](https://github.com/10up/ElasticPress/pull/2364).
- WP-CLI documentation for some commands and parameters. Props [@felipeelia](https://github.com/felipeelia) via [#2369](https://github.com/10up/ElasticPress/pull/2369).

### Changed
- In addition to post titles, now autosuggest also partially matches taxonomy terms. Props [@felipeelia](https://github.com/felipeelia) and [@Rahmon](https://github.com/Rahmon) via [#2347](https://github.com/10up/ElasticPress/pull/2347).
- Date parsing change to avoid `E_WARNING`s. Props [@pschoffer](https://github.com/pschoffer) via [#2340](https://github.com/10up/ElasticPress/pull/2340).

### Fixed
- Comments created by anonymous users (but approved by default) are now indexed. Props [@tomjn](https://github.com/tomjn) and [@Rahmon](https://github.com/Rahmon) via [#2357](https://github.com/10up/ElasticPress/pull/2357).
- Deleted terms are now properly removed from the Elasticsearch index. Props [@felipeelia](https://github.com/felipeelia) via [#2366](https://github.com/10up/ElasticPress/pull/2366).
- Children of deleted terms are now properly removed from the Elasticsearch index. Props [@pschoffer](https://github.com/pschoffer) via [#2349](https://github.com/10up/ElasticPress/pull/2349).
- Post tag duplicated in the Elasticsearch query. Props [@oscarssanchez](https://github.com/oscarssanchez), [@Rahmon](https://github.com/Rahmon), and [@felipeelia](https://github.com/felipeelia) via [#2341](https://github.com/10up/ElasticPress/pull/2341).
- Infinite loading state of ElasticPress Related Posts block in the Widgets Edit Screen. Props [@felipeelia](https://github.com/felipeelia) via [#2353](https://github.com/10up/ElasticPress/pull/2353).
- Return of `Search::integrate_search_queries()` when `is_integrated_request`. Props [@adiloztaser](https://github.com/adiloztaser) via [#2355](https://github.com/10up/ElasticPress/pull/2355).
- Mapping determination based on existing info. Props [@felipeelia](https://github.com/felipeelia) via [#2345](https://github.com/10up/ElasticPress/pull/2345).
- `WP_Term_Query` and `parent = 0`. Props [@felipeelia](https://github.com/felipeelia) and [@juansanchezfernandes](https://github.com/juansanchezfernandes) via [#2344](https://github.com/10up/ElasticPress/pull/2344).
- WP Acceptance Tests. Props [@felipeelia](https://github.com/felipeelia) via [#2352](https://github.com/10up/ElasticPress/pull/2352).
- Typos in the output of some WP-CLI Commands. Props [@rebeccahum](https://github.com/rebeccahum) via [#2336](https://github.com/10up/ElasticPress/pull/2336).

### Security
- Bumped `10up-toolkit` from 1.0.11 to 1.0.12, `terser-webpack-plugin` from 5.1.4 to 5.2.4, `@wordpress/api-fetch` from 3.21.5 to 3.23.1, and `@wordpress/i18n` from 3.18.0 to 3.20.0. Props [@felipeelia](https://github.com/felipeelia) via [#2372](https://github.com/10up/ElasticPress/pull/2372).

## [3.6.2] - 2021-08-26

**Note that the upcoming ElasticPress 3.7.0 release will remove built assets from the `develop` branch, will replace `master` with `trunk`, will build a stable release version including built assets into a `stable` branch, and will include a build script should you want to build assets from a branch.** As such, please plan to update any references you have from `master` to either `stable` or `trunk` depending on whether you require built assets or not.
Expand Down Expand Up @@ -1036,6 +1066,7 @@ See https://github.com/10up/ElasticPress/pulls?utf8=%E2%9C%93&q=is%3Apr+mileston
- Initial plugin release

[Unreleased]: https://github.com/10up/ElasticPress/compare/master...develop
[3.6.3]: https://github.com/10up/ElasticPress/compare/3.6.2...3.6.3
[3.6.2]: https://github.com/10up/ElasticPress/compare/3.6.1...3.6.2
[3.6.1]: https://github.com/10up/ElasticPress/compare/3.6.0...3.6.1
[3.6.0]: https://github.com/10up/ElasticPress/compare/3.5.6...3.6.0
Expand Down
2 changes: 1 addition & 1 deletion CREDITS.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions assets/js/blocks/related-posts/Edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ class Edit extends Component {
number: 100,
};

// Use 0 if in the Widgets Screen
const postId = wp.data.select('core/editor').getCurrentPostId() ?? 0;

this.fetchRequest = wp
.apiFetch({
path: addQueryArgs(
`/wp/v2/posts/${wp.data.select('core/editor').getCurrentPostId()}/related`,
urlArgs,
),
path: addQueryArgs(`/wp/v2/posts/${postId}/related`, urlArgs),
})
.then((posts) => {
this.setState({ posts });
Expand Down
2 changes: 1 addition & 1 deletion dist/js/related-posts-block-script.min.js

Large diffs are not rendered by default.

187 changes: 131 additions & 56 deletions docs/wp-cli.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,131 @@
The following WP-CLI commands are supported by ElasticPress:

* `wp elasticpress index [--setup] [--network-wide] [--per-page] [--nobulk] [--offset] [--indexables] [--show-bulk-errors] [--post-type] [--include]`

Index all posts in the current blog.

* `--network-wide` will force indexing on all the blogs in the network. `--network-wide` takes an optional argument to limit the number of blogs to be indexed across where 0 is no limit. For example, `--network-wide=5` would limit indexing to only 5 blogs on the network.
* `--setup` will clear the index first and re-send the put mapping.
* `--per-page` let's you determine the amount of posts to be indexed per bulk index (or cycle).
* `--nobulk` let's you disable bulk indexing.
* `--offset` let's you skip the first n posts (don't forget to remove the `--setup` flag when resuming or the index will be emptied before starting again).
* `--indexables` lets you specify the Indexable(s) which will be indexed.
* `--show-bulk-errors` displays the error message returned from Elasticsearch when a post fails to index (as opposed to just the title and ID of the post).
* `--post-type` let's you specify which post types will be indexed (by default: all indexable post types are indexed). For example, `--post-type="my_custom_post_type"` would limit indexing to only posts from the post type "my_custom_post_type". Accepts multiple post types separated by comma.
* `--include` Choose which object IDs to include in the index.
* `--post-ids` Choose which post_ids to include when indexing the Posts Indexable (deprecated).
* `--upper-limit-object-id` Upper limit of a range of IDs to be indexed. If indexing IDs from 30 to 45, this should be 45.
* `--lower-limit-object-id` Lower limit of a range of IDs to be indexed. If indexing IDs from 30 to 45, this should be 30.

* `wp elasticpress delete-index [--network-wide]`

Deletes the current Indexables indices. `--network-wide` will force every index on the network to be deleted.

* `wp elasticpress put-mapping [--network-wide] [--indexables]`

Sends plugin put mapping to the current Indexables indices (this will delete the indices). `--network-wide` will force mappings to be sent for every index in the network.

* `wp elasticpress recreate-network-alias`

Recreates the alias index which points to every index in the network.

* `wp elasticpress activate-feature <feature-slug>`

Activate a feature. If a re-indexing is required, you will need to do it manually.

* `wp elasticpress deactivate-feature <feature-slug>`

Deactivate a feature.

* `wp elasticpress list-features [--all]`

Lists active features. `--all` will show all registered features.

* `wp elasticpress stats`

Returns basic stats on Elasticsearch instance i.e. number of documents in current index as well as disk space used.

* `wp elasticpress status`

* `wp elasticpress get-indexes`

Get all index names as json.

* `wp elasticpress get-cluster-indexes`

Return all indexes from the cluster as json.
The following WP-CLI commands are supported by ElasticPress:

* `wp elasticpress index [--network-wide] [--setup] [--per-page] [--nobulk] [--show-errors] [--show-bulk-errors] [--show-nobulk-errors] [--offset] [--indexables] [--post-type] [--include] [--post-ids] [--upper-limit-object-id] [--lower-limit-object-id] [--ep-host] [--ep-prefix] [--yes]`

Index all posts for a site or network wide.

* `[--network-wide]`: Force indexing on all the blogs in the network. `--network-wide` takes an optional argument to limit the number of blogs to be indexed across where 0 is no limit. For example, `--network-wide=5` would limit indexing to only 5 blogs on the network
* `[--setup]`: Clear the index first and re-send the put mapping. Use `--yes` to skip the confirmation
* `[--per-page]`: Determine the amount of posts to be indexed per bulk index (or cycle)
* `[--nobulk]`: Disable bulk indexing
* `[--show-errors]`: Show all errors
* `[--show-bulk-errors]`: Display the error message returned from Elasticsearch when a post fails to index using the /_bulk endpoint
* `[--show-nobulk-errors]`: Display the error message returned from Elasticsearch when a post fails to index while not using the /_bulk endpoint
* `[--offset]`: Skip the first n posts (don't forget to remove the `--setup` flag when resuming or the index will be emptied before starting again).
* `[--indexables]`: Specify the Indexable(s) which will be indexed
* `[--post-type]`: Specify which post types will be indexed (by default: all indexable post types are indexed). For example, `--post-type="my_custom_post_type"` would limit indexing to only posts from the post type "my_custom_post_type". Accepts multiple post types separated by comma
* `[--include]`: Choose which object IDs to include in the index
* `[--post-ids]`: Choose which post_ids to include when indexing the Posts Indexable (deprecated)
* `[--upper-limit-object-id]`: Upper limit of a range of IDs to be indexed. If indexing IDs from 30 to 45, this should be 45
* `[--lower-limit-object-id]`: Lower limit of a range of IDs to be indexed. If indexing IDs from 30 to 45, this should be 30
* `[--ep-host]`: Custom Elasticsearch host
* `[--ep-prefix]`: Custom ElasticPress prefix
* `[--yes]`: Skip confirmation needed by `--setup`

* `wp elasticpress activate-feature <feature-slug>`

Activate a feature. If a re-indexing is required, you will need to do it manually.

* `<feature-slug>`: The feature slug

* `wp elasticpress deactivate-feature <feature-slug>`

Dectivate a feature.

* `<feature-slug>`: The feature slug

* `wp elasticpress list-features [--all]`

List features (either active or all).

* `[--all]`: Show all registered features

* `wp elasticpress get-algorithm-version`

Get the algorithm version.

Get the value of the `ep_search_algorithm_version` option, or
`default` if empty.

* `wp elasticpress set-algorithm-version [--version=<version>] [--default]`

Set the algorithm version.

Set the algorithm version through the `ep_search_algorithm_version` option,
that will be used by the filter with same name.
Delete the option if `--default` is passed.

* `[--version=<version>]`: Version name
* `[--default]`: Use to set the default version

* `wp elasticpress clear-index`

Clear a sync/index process.

If an index was stopped prematurely and won't start again, this will clear this cached data such that a new index can start.

* `wp elasticpress delete-index [--index-name] [--network-wide] [--yes]`

Delete the index for each indexable. !!Warning!! This removes your elasticsearch index(s) for the entire site.

* `[--index-name]`: The name of the index to be deleted. If not passed, all indexes will be deleted
* `[--network-wide]`: Force every index on the network to be deleted.
* `[--yes]`: Skip confirmation

* `wp elasticpress epio-set-autosuggest`

A WP-CLI wrapper to run `Autosuggest::epio_send_autosuggest_public_request()`.

* `wp elasticpress get-cluster-indexes`

Return all indexes from the cluster as a JSON object.

* `wp elasticpress get-indexes`

Return all index names as a JSON object.

* `wp elasticpress get-indexing-status`

Returns the status of an ongoing index operation in JSON array.

Returns the status of an ongoing index operation in JSON array with the following fields:
indexing | boolean | True if index operation is ongoing or false
method | string | 'cli', 'web' or 'none'
items_indexed | integer | Total number of items indexed
total_items | integer | Total number of items indexed or -1 if not yet determined

* `wp elasticpress get-last-cli-index [--clear]`

Returns a JSON array with the results of the last CLI index (if present) of an empty array.

* `[--clear]`: Clear the `ep_last_cli_index` option.

* `wp elasticpress put-mapping [--network-wide] [--indexables] [--ep-host] [--ep-prefix]`

Add document mappings for every indexable.

Sends plugin put mapping to the current Indexables indices (this will delete the indices)

* `[--network-wide]`: Force mappings to be sent for every index in the network.
* `[--indexables]`: List of indexables
* `[--ep-host]`: Custom Elasticsearch host
* `[--ep-prefix]`: Custom ElasticPress prefix

* `wp elasticpress recreate-network-alias`

Recreates the alias index which points to every index in the network.

Map network alias to every index in the network for every non-global indexable

* `wp elasticpress stats`

Get stats on the current index.

* `wp elasticpress status`

Ping the Elasticsearch server and retrieve a status.

* `wp elasticpress stop-indexing`

Stop the indexing operation started from the dashboard.

4 changes: 2 additions & 2 deletions elasticpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: ElasticPress
* Plugin URI: https://github.com/10up/ElasticPress
* Description: A fast and flexible search and query engine for WordPress.
* Version: 3.6.2
* Version: 3.6.3
* Requires at least: 3.7.1
* Requires PHP: 5.6
* Author: 10up
Expand Down Expand Up @@ -32,7 +32,7 @@
define( 'EP_URL', plugin_dir_url( __FILE__ ) );
define( 'EP_PATH', plugin_dir_path( __FILE__ ) );
define( 'EP_FILE', plugin_basename( __FILE__ ) );
define( 'EP_VERSION', '3.6.2' );
define( 'EP_VERSION', '3.6.3' );

/**
* PSR-4-ish autoloading
Expand Down
Loading

0 comments on commit 0cdd808

Please sign in to comment.