By default, ElasticPress indexes posts using a single, default language to analyze their content.
This has two main problems:
- As posts are indexed in the default language, they might appear in search results in that default language, and they might be missing in search results in their own language.
- As posts are indexed in the default language, syncronization can mess with features like stopwords and stemming, resulting in wrongly indexed data.
The purpose of this plugin is providing proper indexing for the content based on its own language.
To do so, this glue plugin appends two additional fields to indexed documents:
post_langstores all the languages where a post might appear as a search result. This includes the post own language, but also some additional languages in case your post type is set to display as translated when some translations are missing. Posts on non-translatable types store here the default language so they can appear on frontend search results.post_unique_langstored the actual, single language of the each post. Posts on non-translatable types store here the default language.
This plugin provides its own wpml_elasticpress WP CLI command that extends the elasticpress one. When using wpml_elasticpress, you can pass some extra attributes:
wp wpml_elasticpress syncwill index all your posts in their default language. The process runs in batches, and languages are indexed one after another.wp wpml_elasticpress sync --post-type=bookwill index posts of the type book in their own language, also in batches, one language at a time.wp wpml_elasticpress sync --post-lang=de,itwill index all posts in German and Italian languages. Note the comma-separated list of language codes.wp wpml_elasticpress sync --post-type=book --post-lang=itwill index only Italian items on the post type book.
This plugin will hook into the ElasticPress Sync dashboard, so ElasticPress can index the relevant content in its own WPML language.
To do so, indexing is split in batches per language. The sync log will show the progress when indexing in every language.
This plugin will ensure than your posts get synced using the right language when they are created or updated in the WordPress backend.
ElasticPress provides several features. We provide compatibility with some of them:
- Post Search
- Instant Results
- Autosuggest
- Did You Mean
- WooCommerce
- Filters
- Related Posts
- Custom Search Results
- Protected Content
- Documents
Additional compatibility with other features will be added in future releases.
After cloning this repository you need to generate the autoloader:
composer dump-autoload
This step isn't needed if you download a release instead.
- Bring support for the
Documentsfeature.
- Fix a problem with a missing stemmer when creating an index for Thai content.
- Update the sync command synopsis to accept the latest elasticpress arguments.
- Improve the management of sites indices in Health stats.
- Cache cluster indices for better performance.
- Unsync documents when moved to a non indexable stati.
- Fix some undefined variables.
- Fix the compatibility with ElasticPress 5.0.0.
- Fix the compatibility with the stopwords analyzers on ElasticPress 4.7.0 or newer.
- Fix an error when deleting and trashing posts on PHP 8.0 or newer.
- Fix the name of the plugin main directory.
- Breaking change: introduce a different index per language.
- Fix
wpml_elasticpressso it analiyzes posts in their own language when indexing them. - Fix the dashboard syncing process so it analiyzes posts in their own language when indexing them.
- Fix the individual post sync-on-save process so it analiyzes the post in its own language. Update synced content on post trashed or deleted.
- Fix the custom fields indexing so language codes are not taken as stopwords.
- Bring support for the
Related postsfeature.
- Filter the search by language.
- Add
wpml_elasticpressCLI command. - Add
post-langparameter to CLI indexing command.