elgentos / magento2-elasticsuite-prismic-search

Magento 2 ElasticSuite Prismic Search
1 stars 0 forks source link

Parse URL rewrites to index pages that have direct URLs #8

Closed peterjaap closed 2 years ago

peterjaap commented 2 years ago

Some content types don't use routes but use URL rewrites.

One way to index these is to parse the url rewrite table;

mysql> SELECT DISTINCT request_path, target_path FROM url_rewrite WHERE target_path LIKE 'prismicio/direct/page/%' LIMIT 2;
+-----------------------+-------------------------------------------------------------------------+
| request_path          | target_path                                                             |
+-----------------------+-------------------------------------------------------------------------+
| assistance/           | prismicio/direct/page/type/static_content_page/uid/support              |
| algemene-voorwaarden/ | prismicio/direct/page/type/static_content_page/uid/terms-and-conditions |
+-----------------------+-------------------------------------------------------------------------+

From those target_path's we can get the type and the uid, and pass them along to the indexer.

peterjaap commented 2 years ago

https://github.com/elgentos/magento2-elasticsuite-prismic-search/commit/f6d5b07df5760b6521beeabd16180a745be0a4c5