Flowpack.ElasticSearch.ContentRepositoryAdaptor
Flowpack.ElasticSearch.ContentRepositoryAdaptor copied to clipboard
Remove "$targetWorkspaceName" from indexer -- as that's a very crude hack
... Instead of manipulating context node path using string replace, we should instead do the following:
if NodeInUserWorkspace is published + should be indexed, create an new context (with same dimension values and DIFFERENT workspace). Then, using this new context, we fetch the published node by node path. Then, we use that one for indexing.
... Discovered together with Christopher at T3CON.
@bwaidelich Is this issue always a problem ? And if it's the case, can push a PR to solve it ?
@dfeyer wrong (se)bastian ;)
@skurfuerst Ping, is this issue fixed now or did we need to tackle it ?
@skurfuerst Ping again, this is quiet old issue, but not sure if it affect the current implementation ?
Hey Dominique,
this is still relevant I think: https://github.com/Flowpack/Flowpack.ElasticSearch.ContentRepositoryAdaptor/blob/a092e415cb18b44dda816608a61a539d2df5f791/Classes/Flowpack/ElasticSearch/ContentRepositoryAdaptor/Indexer/NodeIndexer.php#L144
All the best, Sebastian
Also the current version that string manipulation is still done:
- https://github.com/Flowpack/Flowpack.ElasticSearch.ContentRepositoryAdaptor/blob/070fded224fbef2bb71b53b723961e256a7a015d/Classes/Indexer/NodeIndexer.php#L264
And in three more places:
- https://github.com/Flowpack/Flowpack.ElasticSearch.ContentRepositoryAdaptor/blob/070fded224fbef2bb71b53b723961e256a7a015d/Classes/Indexer/NodeIndexer.php#L181
- https://github.com/Flowpack/Flowpack.ElasticSearch.ContentRepositoryAdaptor/blob/070fded224fbef2bb71b53b723961e256a7a015d/Classes/Driver/Version1/IndexerDriver.php#L93
- https://github.com/Flowpack/Flowpack.ElasticSearch.ContentRepositoryAdaptor/blob/070fded224fbef2bb71b53b723961e256a7a015d/Classes/Driver/Version2/IndexerDriver.php#L95
These should (re-)use calculateDocumentIdentifier()
as defined in https://github.com/Flowpack/Flowpack.ElasticSearch.ContentRepositoryAdaptor/blob/070fded224fbef2bb71b53b723961e256a7a015d/Classes/Indexer/NodeIndexer.php#L259!
@kdambekalns Code duplication is remove here 2e04e1fb3b18247985656adbd962f410229a65fd