FOSElasticaBundle
FOSElasticaBundle copied to clipboard
How to disable persistence completely
I might be going slightly mad, but I cannot find any simple way to disable the persistence functionality completely.
I have two applications.
App 1 - Uses this bundle to create and populate an index from Doctrine ORM as normal.
fos_elastica:
indexes:
people:
client: default
types:
person:
properties:
id: ~
phoneNumber: ~
persistence:
driver: orm
model: App\Messaging\Domain\Model\People\Person
finder: ~
provider: ~
App 2 - Uses this bundle to query the index (no finders) and manually populate a different, localised entity
fos_elastica:
indexes:
people:
client: default
types:
person:
properties:
id: ~
phoneNumber: ~
I'm getting [InvalidArgumentException] No providers were registered for index "people".
How can I completely ignore persistence operations in app 2 ?
Looks like related to #1507
I've now realised this is only really an issue when running the fos:elastica:populate
command.
To get around this, I've patched the command to add an --excluded-indexes
option, that allows me to specify which indexes to exclude when populating.
Happy to submit a PR with this addition if needed.
@benr77 Yes can you please make one ?