SearchService does not work with custom implementation of IDocumentRepository

I created an application based on fullstack template, and replaced the default implementaion of IDocumentRepository by a custom one. My intention was to store data in mongodb and have a dedicated collection for each data-model. It looks like everything is working fine, but when I restart the application, just the example data is displayed and newly added seams to be lost, but is present in database.

Ia a debug session, I have seen the SearchService is getting invoked and I learned SolR is also used, if there is no search criteria.

I expected the problem is fixed, after calling the updateIndex- method of the SearchService like I have seen in DefaultDocumentRepository, but it wasn’t.

Does anybody know what to do to fix it ?

Moin @bernhard-keen-stream,

this issue sounds familiar. Could you check if it works when configuring following property in e.g. application.properties:

mgmtp.a12.dataservices.search.index.initialization.mode=update_index

When you restart the server, this might fix it, because during initialization it otherwise uses the default search index initializer mode REGULAR.
For more details: getA12 documentation

Thanks a lot ! Now it’s working. :grinning: :hugs: :partying_face: The data created within my previous desperate trials to fix it, is listed, too. Should we better use “update_index” as the default behaviour in A12 ?

We’ve added the respective property and configuration for spring and also in the docker_compose.yml in the Project Template out of the box in a previous release.

Therefore, for A12 projects we provide the mgmtp.a12.dataservices.search.index.initialization.mode=update_index as default to use in the spring profile local-db :slight_smile: