Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #358 from DivanteLtd/develop
Browse files Browse the repository at this point in the history
Release 2.0.0
  • Loading branch information
afirlejczyk authored Nov 4, 2020
2 parents 089e242 + cf7ef11 commit b4a2b2b
Show file tree
Hide file tree
Showing 117 changed files with 2,190 additions and 2,465 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
- Fix error "Invalid template file..." when reindexing cms blocks/pages by cron. ([#191](https://github.com/DivanteLtd/magento2-vsbridge-indexer/pull/351))
- Fix providing label for the configurable_options field. Field is now using the label assigned for the currently active (reindex) store. ([#339](https://github.com/DivanteLtd/magento2-vsbridge-indexer/pull/352))

## [2.0]

- Added support for ES6+. You can choose ES version in configuration (by default ES5 is selected). For ES 5 only one index is created, for ES6+ we have separated indices per type
- vsbridge_indexer.xml was replaced with vsbridge.xml. You declare type/entity and mapping in vsbridge.xml
- Dataproviders configuration was moved to di.xml

## [1.21.0] (2020.09.16)

### Fixed
Expand Down
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,21 @@ Sign up for a demo at https://vuestorefront.io/ (Vue Storefront integrated with

## Overview

### Version 1.5.0/1.5.1 - support for aliases.


### Version 1.x
Pull Requests should be made against 1.x branch. Changes from this branch won't be merge to main branch.
Only fixes will be accepted.

### Version 2.0
Support ES5 and ES6+.

##### To read what changed click [here](CHANGELOG.MD#20)

##### How to upgrade to 2.0
Click here to find out [more](docs/upgrade-to-2.0.md)

##### Version 1.5.0/1.5.1 - support for aliases.
Command ` php bin/magento vsbridge:reindex --all` will reindex all data to new index.
It will create new index and update aliases at the end.

Expand Down Expand Up @@ -79,7 +93,7 @@ Configure the module in Magento panel and run full indexation.

**Check configuration [here](docs/configuration.md)**

### Update VSF/VSF-API configuration
### Update VSF/VSF-API configuration for ES5
**Important**: It is crucial to update configuration `elasticsearch.index` in the VSF and `elasticsearch.indices` in VSF-API

*Index Alias Prefix* → define prefixes for ElasticSearch indexes. The panel allows adding prefix only to the catalog name e.g.: *vue_storefront_catalog*. For each store (store view) index name is generated on the base of defined prefix and either ID or Store Code. Aliases cannot be created.
Expand Down Expand Up @@ -195,7 +209,10 @@ If you need a list off all available index-names, you can use `php bin/magento i

*Update on Schedule* mode observes changes in corresponding tables, and probably will be more relevant in most cases. It is the default mode in any bigger stores.



### Compatibility
--- version 2.0 - tested with ES: 5.6.11, 6.8.0, 7.6.2

-- Vue Storefront >= 1.4.4
Module was tested on:
Expand Down
98 changes: 44 additions & 54 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,57 +1,47 @@
{
"name": "divante/magento2-vsbridge-indexer",
"type": "magento2-component",
"license": "MIT",
"authors": [{
"name": "Agata",
"email": "[email protected]"
}],
"keywords": [
"magento",
"magento2",
"vuestorefront"
],
"repositories": [
{
"type": "composer",
"url": "https://repo.magento.com/"
}
],
"require": {
"php": ">=7.0.2",
"magento/framework": ">=101.0.0",
"magento/module-store": ">=100.2.0",
"magento/module-backend": ">=100.2.0",
"magento/module-catalog": ">=102.0.0",
"magento/magento-composer-installer": "*",
"elasticsearch/elasticsearch": "~5.1|~6.1"
},
"replace": {
"divante/module-vsf-indexer-core": "self.version",
"divante/module-vsf-indexer-catalog": "self.version",
"divante/module-vsf-indexer-tax": "self.version",
"divante/module-vsf-indexer-cms": "self.version"
},
"autoload": {
"files": [
"src/module-vsbridge-indexer-agreement/registration.php",
"src/module-vsbridge-indexer-core/registration.php",
"src/module-vsbridge-indexer-catalog/registration.php",
"src/module-vsbridge-indexer-cms/registration.php",
"src/module-vsbridge-indexer-review/registration.php",
"src/module-vsbridge-indexer-tax/registration.php",
"src/module-vsbridge-downloadable/registration.php"
"name": "divante/magento2-vsbridge-indexer",
"type": "magento2-component",
"license": "MIT",
"keywords": [
"magento",
"magento2",
"vuestorefront"
],
"psr-4": {
"Divante\\VsbridgeIndexerAgreement\\": "src/module-vsbridge-indexer-agreement",
"Divante\\VsbridgeIndexerCore\\": "src/module-vsbridge-indexer-core",
"Divante\\VsbridgeIndexerCatalog\\": "src/module-vsbridge-indexer-catalog",
"Divante\\VsbridgeIndexerCms\\": "src/module-vsbridge-indexer-cms",
"Divante\\VsbridgeIndexerReview\\": "src/module-vsbridge-indexer-review",
"Divante\\VsbridgeIndexerTax\\": "src/module-vsbridge-indexer-tax",
"Divante\\VsbridgeDownloadable\\": "src/module-vsbridge-downloadable"
}
},
"minimum-stability": "dev",
"prefer-stable": true
"repositories": [
{
"type": "composer",
"url": "https://repo.magento.com/"
}
],
"require": {
"php": ">=7.0.2",
"magento/framework": ">=101.0.0",
"magento/module-store": ">=100.2.0",
"magento/module-backend": ">=100.2.0",
"magento/module-catalog": ">=102.0.0",
"magento/magento-composer-installer": "*",
"elasticsearch/elasticsearch": "~5.1|~6.1|~7.1"
},
"autoload": {
"files": [
"src/module-vsbridge-indexer-core/registration.php",
"src/module-vsbridge-indexer-catalog/registration.php",
"src/module-vsbridge-indexer-cms/registration.php",
"src/module-vsbridge-indexer-review/registration.php",
"src/module-vsbridge-indexer-tax/registration.php",
"src/module-vsbridge-downloadable/registration.php",
"src/module-vsbridge-indexer-agreement/registration.php"
],
"psr-4": {
"Divante\\VsbridgeIndexerAgreement\\": "src/module-vsbridge-indexer-agreement",
"Divante\\VsbridgeIndexerCore\\": "src/module-vsbridge-indexer-core",
"Divante\\VsbridgeIndexerCatalog\\": "src/module-vsbridge-indexer-catalog",
"Divante\\VsbridgeIndexerCms\\": "src/module-vsbridge-indexer-cms",
"Divante\\VsbridgeIndexerReview\\": "src/module-vsbridge-indexer-review",
"Divante\\VsbridgeIndexerTax\\": "src/module-vsbridge-indexer-tax",
"Divante\\VsbridgeDownloadable\\": "src/module-vsbridge-downloadable"
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
18 changes: 10 additions & 8 deletions docs/configuration.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
### Magento Configuration
Go to the new ‘Indexer’ section (Stores → Configuration → Vuestorefront → Indexer), available now in the in the Magento Panel, and configure it in the listed areas:
1. ####General settings → Enable VS Bridge

Enable to export data to elasticsearch. By default indexing is disable.
1. ####General settings

![](./images/config-general-enable.png)

1. ####General settings → List of stores to reindex

Select stores for which data must be exported to ElasticSearch. By default stores 0 to 1 are selected. For each store view, a new, separate ElasticSearch index is created.
**Enable VS Bridge** → Enable to export data to elasticsearch. By default indexing is disable.

**Elasticsearch version**

Select ES version depends on which ES you are using/is used by magento.
If you are using ES 5.x.x, choose Elasticsearch5, if you are using version 6.x.x or 7.x.x choose Elasticsearch6+.
By default Elasticsearch5 option is selected.

**List of stores to reindex** → Select stores for which data must be exported to ElasticSearch. By default store with ID 1 is selected. For each store view, a new, separate ElasticSearch index is created.

![](./images/config-general.png)

Expand Down
Binary file removed docs/images/config-general-enable.png
Binary file not shown.
Binary file modified docs/images/config-general.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions docs/upgrade-to-2.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
1. Vsbridge_indexer.xml was replaced with vsbridge.xml
- Vsbridge.xml keep information about type/entity and mapping.
- Datapvoriderds were moved to di.xml
Example:

Before:
```
<indices xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Divante_VsbridgeIndexerCore:etc/vsbridge_indices.xsd">
<index identifier="vue_storefront_catalog">
<type name="taxrule" mapping="Divante\VsbridgeIndexerTax\Index\Mapping\Tax">
<data_providers>
<data_provider name="tax_classes">Divante\VsbridgeIndexerTax\Model\Indexer\DataProvider\TaxClasses</data_provider>
<data_provider name="tax_rates">Divante\VsbridgeIndexerTax\Model\Indexer\DataProvider\TaxRates</data_provider>
</data_providers>
</type>
</index>
</indices>
```

After:
**vsbridge:xml**
```
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Divante_VsbridgeIndexerCore:etc/vsbridge.xsd">
<type identifier="taxrule" mapping="Divante\VsbridgeIndexerTax\Index\Mapping\Tax"/>
</config>
```

**di.xml**
```
<type name="Divante\VsbridgeIndexerCore\Index\DataProviderResolver">
<arguments>
<argument name="dataProviders" xsi:type="array">
<item name="taxrule" xsi:type="array">
<item name="tax_classes" xsi:type="object">Divante\VsbridgeIndexerTax\Model\Indexer\DataProvider\TaxClasses</item>
<item name="tax_rates" xsi:type="object">Divante\VsbridgeIndexerTax\Model\Indexer\DataProvider\TaxRates</item>
</item>
</argument>
</arguments>
</type>
```
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<?php
/**
* Copyright Divante Sp. z o.o.
* See LICENSE_DIVANTE.txt for license details.
*/

namespace Divante\VsbridgeIndexerAgreement\Model\Indexer\Action;


use Divante\VsbridgeIndexerAgreement\Model\ResourceModel\Agreement as AgreementResource;
use Divante\VsbridgeIndexerCore\Indexer\RebuildActionInterface;

class Agreement
/**
* Class Agreement
*/
class Agreement implements RebuildActionInterface
{
/**
* @var AgreementResource
Expand All @@ -32,7 +31,7 @@ public function __construct(AgreementResource $agreementResource)
*
* @return \Traversable
*/
public function rebuild($storeId = 1, array $agreementIds = [])
public function rebuild(int $storeId, array $agreementIds): \Traversable
{
$lastAgreementId = 0;

Expand Down
90 changes: 0 additions & 90 deletions src/module-vsbridge-indexer-agreement/Model/Indexer/Agreement.php

This file was deleted.

13 changes: 8 additions & 5 deletions src/module-vsbridge-indexer-agreement/etc/di.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<virtualType name="Divante\VsbridgeIndexerAgreement\Indexer\AgreementIndexerHandlerVirtual"
type="Divante\VsbridgeIndexerCore\Indexer\GenericIndexerHandler">

<virtualType name="Divante\VsbridgeIndexerAgreement\Model\Indexer\Agreement"
type="Divante\VsbridgeIndexerCore\Indexer\Base">
<arguments>
<argument name="indexIdentifier" xsi:type="string">vue_storefront_catalog</argument>
<argument name="typeName" xsi:type="string">agreement</argument>
</arguments>
</virtualType>
<type name="Divante\VsbridgeIndexerAgreement\Model\Indexer\Agreement">

<type name="Divante\VsbridgeIndexerCore\Indexer\RebuildActionPool">
<arguments>
<argument name="indexerHandler" xsi:type="object">Divante\VsbridgeIndexerAgreement\Indexer\AgreementIndexerHandlerVirtual</argument>
<argument name="actions" xsi:type="array">
<item name="agreement" xsi:type="string">Divante\VsbridgeIndexerAgreement\Model\Indexer\Action\Agreement</item>
</argument>
</arguments>
</type>

Expand Down
4 changes: 4 additions & 0 deletions src/module-vsbridge-indexer-agreement/etc/vsbridge.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Divante_VsbridgeIndexerCore:etc/vsbridge.xsd">
<type identifier="agreement" mapping="Divante\VsbridgeIndexerAgreement\Index\Mapping\Agreement" />
</config>

This file was deleted.

Loading

0 comments on commit b4a2b2b

Please sign in to comment.