Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OP-288: ES refactor #245

Merged
merged 35 commits into from
Jun 10, 2024
Merged

OP-288: ES refactor #245

merged 35 commits into from
Jun 10, 2024

Conversation

GracjanJozefczyk
Copy link
Member

@GracjanJozefczyk GracjanJozefczyk commented May 27, 2024

Changes in SyliusElasticsearchPlugin v4:

  • Added pagination and sorting for site-wide search.
  • Deprecated classic filters and replaced them with facets.
  • Implemented attributes and options autodiscovery with advanced facets configuration (autodiscovery, register one-by-one, exclude).
  • Renamed classes to maintain "site-wide" and "taxon" naming consistency.
  • Replaced Sonata block event with Sylius UI.
  • Improved performance.
  • Refactored Symfony forms.
  • Refactored controllers.
  • Enhanced aggregations (they now update together with results).
  • Updated documentation.
  • Added Docker setup.
  • Improved the test application.
  • Dropped support for Sylius 1.12, PHP 7, and PHP 8.0 (constructor refactor).
  • Fixed toggles on mobile view

@GracjanJozefczyk GracjanJozefczyk marked this pull request as ready for review May 28, 2024 15:29
.github/workflows/build.yml Outdated Show resolved Hide resolved
src/Repository/ProductOptionRepository.php Show resolved Hide resolved
tests/Application/.env Outdated Show resolved Hide resolved
BITBAG_ES_HOST=localhost
BITBAG_ES_PORT=9200
###< sylius/elasticsearch-plugin ###
ELASTICSEARCH_URL=http://localhost:9200/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What with the BITBAG_ES_INDEX_PREFIX? Will be without this an index collisions?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feature is not even documented, my code does not affect it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The BITBAG_ES_INDEX_PREFIX is an environment variable, which is added to index name to add support for multiple Sylius' installed in one server with this plugin installed.

src/Controller/Action/Shop/TaxonProductsSearchAction.php Outdated Show resolved Hide resolved
$sort = $requestData[self::SORT_INDEX] ?? self::SORT_ASC_INDEX;

$availableSorters = [$positionSortingProperty, $this->soldUnitsProperty, $this->createdAtProperty, $this->pricePropertyPrefix];
$availableSorters = [$this->soldUnitsProperty, $this->createdAtProperty, $this->pricePropertyPrefix];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if someone want to add custom sorter? Class decoration will be necessary to do this? What do you think about changing this prefixes to one symfony array parameter which can be easily override?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Custom sort logic has to be implemented anyway. Not in scope of this task, but thanks for the idea. We can maybe schedule it for some other time.

@BartoszWojdalowicz
Copy link
Contributor

Upgrade guide will be helpful.

@GracjanJozefczyk
Copy link
Member Author

Upgrade guide will be helpful.

Right, done.

Copy link
Member

@senghe senghe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two OS headers missing. The code looks great!

src/Form/Resolver/FacetsResolver.php Show resolved Hide resolved
BITBAG_ES_HOST=localhost
BITBAG_ES_PORT=9200
###< sylius/elasticsearch-plugin ###
ELASTICSEARCH_URL=http://localhost:9200/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The BITBAG_ES_INDEX_PREFIX is an environment variable, which is added to index name to add support for multiple Sylius' installed in one server with this plugin installed.

@senghe senghe merged commit 6d4b136 into master Jun 10, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants