Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/onthegosystems/wpml-elasticpress
WPML ElasticPress adds support for languages in ElasticPress.
https://github.com/onthegosystems/wpml-elasticpress
wpml-glue-plugin
Last synced: about 1 month ago
JSON representation
WPML ElasticPress adds support for languages in ElasticPress.
- Host: GitHub
- URL: https://github.com/onthegosystems/wpml-elasticpress
- Owner: OnTheGoSystems
- License: gpl-3.0
- Created: 2020-08-11T17:16:26.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-07-10T12:48:18.000Z (6 months ago)
- Last Synced: 2024-07-10T14:58:42.831Z (6 months ago)
- Topics: wpml-glue-plugin
- Language: PHP
- Homepage:
- Size: 153 KB
- Stars: 10
- Watchers: 23
- Forks: 3
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: license.txt
Awesome Lists containing this project
README
# WPML ElasticPress integration
![OTGS CI](https://github.com/OnTheGoSystems/wpml-elasticpress/workflows/OTGS%20CI/badge.svg)
## The main goal
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_lang` stores 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_lang` stored the actual, single language of the each post. Posts on non-translatable types store here the default language.## Additional CLI command
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 sync` will 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=book` will 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,it` will 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=it` will index only Italian items on the post type book.## Dashboard indexing
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.
## Post save indexing
This plugin will ensure than your posts get synced using the right language when they are created or updated in the WordPress backend.
## Feature support
ElasticPress provides several features. We provide compatibility with some of them:
* [x] Post Search
* [ ] Instant Results
* [ ] Autosuggest
* [ ] Did You Mean
* [ ] WooCommerce
* [ ] Filters
* [x] Related Posts
* [ ] Custom Search Results
* [ ] Protected Content
* [ ] DocumentsAdditional compatibility with other features will be added in future releases.
## Building from source
After cloning this repository you need to generate the autoloader:
`composer dump-autoload`This step isn't needed if you download a release instead.
## Changelog
### 2.0.0
- **Breaking change**: introduce a different index per language.
- Fix `wpml_elasticpress` so 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 posts` feature.### 1.0.0
- Filter the search by language.
- Add `wpml_elasticpress` CLI command.
- Add `post-lang` parameter to CLI indexing command.