Flowpack.ElasticSearch.ContentRepositoryAdaptor icon indicating copy to clipboard operation
Flowpack.ElasticSearch.ContentRepositoryAdaptor copied to clipboard

Remove "$targetWorkspaceName" from indexer -- as that's a very crude hack

Open skurfuerst opened this issue 10 years ago • 7 comments

... 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.

skurfuerst avatar Oct 10 '14 13:10 skurfuerst

@bwaidelich Is this issue always a problem ? And if it's the case, can push a PR to solve it ?

dfeyer avatar Aug 05 '16 14:08 dfeyer

@dfeyer wrong (se)bastian ;)

bwaidelich avatar Aug 06 '16 08:08 bwaidelich

@skurfuerst Ping, is this issue fixed now or did we need to tackle it ?

dfeyer avatar Aug 06 '16 08:08 dfeyer

@skurfuerst Ping again, this is quiet old issue, but not sure if it affect the current implementation ?

dfeyer avatar Oct 05 '16 20:10 dfeyer

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

skurfuerst avatar Oct 17 '16 06:10 skurfuerst

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 avatar Jun 02 '17 15:06 kdambekalns

@kdambekalns Code duplication is remove here 2e04e1fb3b18247985656adbd962f410229a65fd

dfeyer avatar Apr 07 '19 22:04 dfeyer