Commit graph

236 commits

Author SHA1 Message Date
Joris van de Sande 588c4e2d02 Unset nested "fields" for deeper nested configs too 2014-03-31 12:52:29 +02:00
nurikabe 0de48d2190 Use identifiers for bulk delete rather than cloning objects 2014-03-29 18:36:06 -04:00
nurikabe 720917f609 Clone entities on delete to preserve ids 2014-03-24 11:16:31 -04:00
Joris van de Sande 455ff9e0f7 Unset fields if no nested fields are defined 2014-03-24 15:06:24 +01:00
Tim Nagel 857c1c8e48 Merge pull request #415 from nurikabe/master
Refactoring to update ElasticSearch index in postFush
2014-03-17 09:11:43 +11:00
Lea Haensenberger 726892c586 Ignore TypeMissingException when resetting a single type. This allows to create new types without having to recreate the whole index. 2014-03-13 10:43:35 +01:00
tgallice 418b9d72ce Rework configuration validation to fix #461 2014-03-04 17:58:10 +01:00
Karel Souffriau 41bf07ec59 Fixed issues in #426 2014-02-19 12:19:34 +01:00
Tim Nagel d03d494d30 Merge remote-tracking branch 'tgabi/stop-on-error' 2014-02-19 13:50:33 +11:00
Hung Tran 5be3a8c22e added query string to collector and updated tests 2014-02-05 11:58:13 -06:00
nurikabe 559d7c13f2 Update tests 2014-02-01 03:37:47 +00:00
Tóth Gábor bbacad4bab no-stop-on-error option added to populate command 2014-01-21 18:38:51 +01:00
nurikabe 4a4716a55b Merge remote-tracking branch 'upstream/master' 2014-01-11 16:38:29 +00:00
nurikabe 7481376835 Use bulk insert. Still working on bulk update/delete which is not yet suppored in Elastica. 2014-01-11 16:28:15 +00:00
Tim Nagel 21f688e014 Merge pull request #433 from FriendsOfSymfony/fix-reset-command
Fix reset command
2013-12-17 02:34:00 -08:00
Lea Haensenberger e906d780ad Adding tests 2013-12-16 12:06:53 +01:00
Lea Haensenberger 05ee300ddb Fixing reset command to allow resetting of just one type, starting to write test 2013-12-16 11:58:58 +01:00
Craig Marvelley 292af9f039 Better variable names 2013-12-12 22:57:02 +00:00
Craig Marvelley 11a87c5ce3 Add test for ElasticaToModelTransformerCollection::hybridTransform 2013-12-12 20:48:15 +00:00
Craig Marvelley 090f02b05d Improve test coverage 2013-12-12 11:11:34 +00:00
Lea Haensenberger a59385af7b Do not set default value to *, might conflict when using e.g. path_match and match_pattern regex together 2013-12-10 15:37:41 +01:00
Lea Haensenberger 0aa98d2295 Fixing copy&paste error 2013-12-10 15:21:46 +01:00
Lea Haensenberger e55c7e8632 Set match to '*' by default 2013-12-10 15:21:46 +01:00
Lea Haensenberger 09031457cd Allow more matching methods 2013-12-10 15:21:46 +01:00
Lea Haensenberger bad1769c84 Fixing tests 2013-12-10 15:21:46 +01:00
Tim Nagel 8668537740 Merge pull request #400 from cordoval/cleanups
clean ups
2013-12-10 02:15:53 -08:00
Tim Nagel fc64078575 Merge pull request #413 from damienalexandre/serializer-integration
Serializer support in providers and mapping configuration fixes
2013-12-09 12:35:26 -08:00
Damien Alexandre 1ddd7c0e0c Store connection infos for all transports, display infos in debug 2013-12-09 14:46:06 +01:00
Damien Alexandre ca507a5e34 Add full_host in logger for HTTP(s) queries 2013-12-09 10:40:47 +01:00
nurikabe 1d700261ab Refactor to a single Listener class. Update tests. 2013-12-02 12:42:04 +00:00
Damien Alexandre 3027c687e2 Ref #341, fix the insertMany method to use Bulk indexing
To make it works, I inject the serializer defined for the Type
into the fos_elastica.object_serializer_persister service.

This is the SAME service injected in the setSerializer of Type.

We deport the handling of serialization outside Elastica,
this is not so good but we need to build our own Documents to
get the ID's correctly.
2013-11-29 15:35:59 +01:00
Damien Alexandre e180f1fd61 Merge remote-tracking branch 'peerj/ObjectWithoutProperties' into serializer-integration
Conflicts:
	Transformer/ModelToElasticaAutoTransformer.php
2013-11-29 13:51:58 +01:00
Damien Alexandre d546b4d3f3 Merge remote-tracking branch 'origin/serializer-transformer' into serializer-integration
Conflicts:
	DependencyInjection/FOSElasticaExtension.php
	Resources/config/config.xml
2013-11-29 10:07:13 +01:00
Luis Cordova cacb40286c clean ups 2013-11-20 08:11:15 -05:00
Tim Nagel 3c26f157aa Merge branch '2.1.x'
Conflicts:
	Tests/ResetterTest.php
2013-11-11 13:30:29 +11:00
Tim Nagel 52d5d0d55f Remove incorrect copyright header 2013-11-11 13:21:36 +11:00
Tim Nagel 9b6b0b0148 Add query_builder_method option to the transformers 2013-11-11 13:14:02 +11:00
Pierre du Plessis 97c98a0243 Add Symfony ExpressionLanguage support for indexable callback 2013-11-04 00:09:21 +02:00
Karel Souffriau c68bb411ac Add support for dynamic templates 2013-10-30 13:39:43 +01:00
Tim Nagel 85c4dc92f9 Merge tag 'v2.1.3'
Conflicts:
	DependencyInjection/Configuration.php
	README.md
2013-10-30 09:06:48 +11:00
Karel Souffriau 9d1201099d Add date format field 2013-10-29 12:20:32 +01:00
Lea Haensenberger 77156b35aa some formatting and cleaning up 2013-07-18 10:54:11 +02:00
Jeremy Mikola 4a889406e9 Merge branch '2.0.x' into 2.1.x
Conflicts:
	Tests/Transformer/ModelToElasticaAutoTransformerTest.php
2013-07-17 15:55:55 -04:00
Jeremy Mikola ab0c27c481 Fix expected exception class (related to #338)
This corrects a typo in a66a37aebd.
2013-07-17 15:54:06 -04:00
Jeremy Mikola 7ae4be0062 Merge branch '2.0.x' into 2.1.x
Conflicts:
	Tests/Transformer/ModelToElasticaAutoTransformerTest.php
2013-07-17 15:49:09 -04:00
Lea Haensenberger d10e8f56c8 Tests for new provider and new transformer 2013-07-17 10:10:07 +02:00
Jeremy Mikola 9e2e8ab1c9 Fix missing getter for private field test for PropertyAccess 2.3+
See: df67239b02
2013-07-12 17:32:33 -04:00
Antonio J. García Lagar 7f3cfa49fb Make the property param optional 2013-06-19 13:57:15 +02:00
Antonio J. García Lagar a386ffefe3 Fix parent mapping 2013-06-17 21:19:11 +02:00
Patrick McAndrew fab42fa0ce Properities should not be required for object as elastica can automap 2013-05-24 12:27:37 +01:00
Jeremy Mikola ee6f3cb04d Expect a more specific PropertyAccess exception
RuntimeException is the nearest common ancestor of the PropertyAccessDeniedException (removed in 2.3) and NoSuchPropertyException.

See: symfony/symfony@2a666cb7c3
2013-05-02 11:24:27 -04:00
Tom Corrigan b204f5bf5f Allow symfony >= 2.3
This required a small tweak to the tests as
Symfony\Component\PropertyAccess\Exception\PropertyAccessDeniedException
 has been removed in 2.3
2013-05-03 01:01:29 +10:00
Lukas Kahwe Smith aafb6e53fb made the bundle compatible with Elastica 0.20.x 2013-04-26 14:10:05 +02:00
Karel Souffriau 83e27ede93 Require PropertyAccess component 2013-04-04 21:51:03 +02:00
Jeremy Mikola 2e7d2f2452 Support Symfony 2.2 PropertyAccess with BC for 2.1 (closes #218)
By abstracting the property access, we can easily support Symfony 2.1's Form component and 2.2's PropertyAccess component.

The PropertyAccessor service will be injected into transformers if it is available. Tests were modified to do the same, and expect the appropriate exception depending on which implementation is available.
2013-03-27 17:26:47 -04:00
Jeremy Mikola 440c36f537 Merge remote-tracking branch 'cevou/master' into pr/245
Conflicts:
	Command/PopulateCommand.php
	Command/SearchCommand.php
	DependencyInjection/Configuration.php
	Doctrine/AbstractElasticaToModelTransformer.php
	Doctrine/AbstractListener.php
	Doctrine/MongoDB/ElasticaToModelTransformer.php
	Doctrine/ORM/ElasticaToModelTransformer.php
	Doctrine/RepositoryManager.php
	Finder/TransformedFinder.php
	Paginator/PaginatorAdapterInterface.php
	Paginator/RawPaginatorAdapter.php
	Persister/ObjectPersister.php
	Propel/ElasticaToModelTransformer.php
	Subscriber/PaginateElasticaQuerySubscriber.php
	Tests/DataCollector/ElasticaDataCollectorTest.php
	Tests/Doctrine/AbstractProviderTest.php
	Tests/Doctrine/RepositoryManagerTest.php
	Tests/Manager/RepositoryManagerTest.php
	Tests/RepositoryTest.php
	Transformer/ElasticaToModelTransformerCollection.php
	composer.json
2013-03-27 14:58:34 -04:00
Jeremy Mikola 3fb9aaa56a Rename FOQ namespaces and services to FOS 2013-03-27 13:44:06 -04:00
Jeremy Mikola b12b92845c Merge branch '2.0' 2013-03-07 17:54:21 -05:00
Jeremy Mikola 9ec6a0ae1b Update test assertions for date format 2013-03-07 17:53:08 -05:00
cevou b03ee7cc76 Removed property path changes again 2013-03-04 21:20:55 +01:00
cevou cbe6071969 Code cleanup
- updated deprecated calls
- cleaned up PHPDoc comments
2013-03-02 12:23:44 +01:00
tyx f66858ff3e Add test for the query time in datacollector 2013-02-21 10:52:49 +01:00
Richard Miller 8fde6b235c Merge branch '2.0'
Conflicts:
	Transformer/ElasticaToModelTransformerCollection.php
2012-11-28 21:15:13 +00:00
Julien Muetton 79eb062cf7 add _parent in mapping during index reset 2012-11-28 12:07:09 +01:00
Julien Muetton a36ec87f40 Add tests for _parent, nested and object types 2012-11-26 14:47:08 +01:00
Richard Miller 5f1e1326d5 Fixing identifier field not being set in TransformerCollection 2012-09-24 23:15:05 +01:00
Richard Miller ce5223f85d Updated test to reflect change in IndexManager constrcutor arguments 2012-08-14 10:04:20 +01:00
Richard Miller 67a11a59ce Merge branch '2.0'
Conflicts:
	Finder/FinderInterface.php
	Repository.php
2012-08-07 19:42:38 +01:00
Richard Miller 16f439cfaf Stopped logger collecting data when not in debug mode 2012-08-07 19:39:14 +01:00
Richard Miller a14d56720f Added findHybrid to Repository 2012-08-07 19:25:43 +01:00
Richard Miller 7a8664727c Merge remote-tracking branch 'origin/attachment_type_transformation'
Conflicts:
	Tests/Transformer/ModelToElasticaAutoTransformerTest.php
	Transformer/ModelToElasticaAutoTransformer.php
2012-07-08 15:38:09 +01:00
Richard Miller aa611605b6 Updated test to reflect changes in the way properties are accessed in the transformer 2012-07-08 14:31:19 +01:00
Francisco Facioni 4f26eb6e21 Updated Test to reflect actual configuration case (this bundle is using arrays instead of Elastica_Type_Mapping) 2012-07-02 10:00:40 -03:00
Richard Miller d0085057d5 Fixed modifier issue in Test 2012-06-13 17:22:13 +01:00
Richard Miller 9f3b3daea2 Merge branch '2.0'
Conflicts:
	Command/PopulateCommand.php
2012-06-13 17:08:08 +01:00
Richard Miller ba75ca8d7b Updated location of composer autoload in test bootstrap file 2012-06-13 17:01:10 +01:00
fran6co 927030914c Fixed bug when a transformer returns objects of different classes.\n The doctrine transformer can generate this kind of situations whene it returns proxy objects. 2012-05-05 17:00:42 +01:00
Richard Miller 99c1826d6d Merge pull request #103 from Fran6co/fix-transformer
Fixed bug when a transformer returns objects of different classes
2012-05-05 08:54:10 -07:00
fran6co 1c1c33d327 Fixed bug when a transformer returns objects of different classes.\n The doctrine transformer can generate this kind of situations whene it returns proxy objects. 2012-05-02 23:06:41 -03:00
Richard Miller 38d863e3ff Added tests attachment fixture 2012-05-01 20:09:04 +01:00
Richard Miller 146cf891cd Added transforming mapped attachments 2012-04-19 21:26:19 +01:00
Jeremy Mikola 86cdaa7c3c [Listener] Support additional indexable callback types
Support service/method tuples as indexable callbacks. Closures are also supported, although they cannot be injected by the service container.

The indexable callback is now injected via a setter and validated when set (instead of during event processing).
2012-04-16 12:30:30 -04:00
Jeremy Mikola 78a36c196d [Listener] Use common AbstractListenerTest for ORM and MongoDB ODM 2012-04-16 12:29:25 -04:00
Jeremy Mikola 7f05e8311a Skip Doctrine tests if libraries are not available
Conflicts:

	Tests/Doctrine/RepositoryManagerTest.php
2012-04-10 17:50:27 -04:00
Jeremy Mikola f559700766 Fix typo in Doctrine/AbstractProviderTest 2012-03-12 14:13:54 -04:00
Jeremy Mikola 4a80e27283 Enable PopulateCommand to target indexes and types
This makes the Populator service obsolete.
2012-03-12 12:07:51 -04:00
Jeremy Mikola 118900120b [Provider] ProviderRegistry should return indexed provider arrays
Since Provider instances do not know the index or type for which they are responsible, it's helpful for the ProviderRegistry to include that information when returning multiple providers.
2012-03-12 12:07:51 -04:00
Jeremy Mikola e09225eb09 [Provider] Change provider construction (possible BC break)
* Created AbstractProvider class (for all DB services), which handles the default batch_size option.
 * The logger Closure is now optional for populate().
 * Removed unused Elastica_Type argument from Provider constructors.
 * Added unit tests for Doctrine's AbstractProvider class.
 * The extra argument (ManagerRegistry) for Doctrine providers is now an appended constructor argument, so the extension no longer needs to use different replacement indexes for Propel/Doctrine providers.
2012-03-12 12:07:51 -04:00
Jeremy Mikola 89a368ae35 Allow Resetter to target specific indexes and types (BC break)
The original reset() method is now resetAllIndexes(). Additionally, new resetIndex() and resetIndexType() methods were introduced.
2012-03-12 12:07:51 -04:00
Jeremy Mikola 2d2e209373 Remove obsolete MappingRegistry class 2012-03-12 12:07:51 -04:00
Jeremy Mikola b360a36737 [Provider] Create ProviderRegistry service (BC break)
This introduces a registry service for persistence providers.

Previously, tagging one or more provider services would cause AddProviderPass to clobber the default providers created by the bundle's extension class. Now, the extension class tags its created providers and allows them to be registered via RegisterProvidersPass just like custom providers.

BC break: Custom providers tagged "foq_elastica.provider" must now specify a "type" attribute on their tag. An "index" attribute is optional (the default ES index will be used by default).
2012-03-12 12:07:51 -04:00
Jeremy Mikola 43eda480c5 Rename "reseter" to "Resetter" (BC break) 2012-03-12 12:07:51 -04:00
Jeremy Mikola d3a2335a55 Refactor IndexManager construction (preserves API)
Provide the default index name rather than the service itself. Additionally, inject references to each index by name instead of the definitions.
2012-03-12 12:07:51 -04:00
Jeremy Mikola b60256e8fd Merge branch '2.0' 2012-03-06 20:34:30 -05:00
Jeremy Mikola 0391dff44e Configure Travis CI
This also changes the test suite and bootstrap to depend on packages installed by composer.
2012-03-06 20:33:50 -05:00
Jeremy Mikola 3eb923cc84 Skip Doctrine tests if libraries are not available 2012-03-06 20:22:34 -05:00
Richard Miller 3e50cc95b5 Merge branch '2.0' 2012-02-27 20:13:39 +00:00
Richard Miller 2e5bac1f52 Removed filtering of null values in transformer 2012-02-27 19:37:59 +00:00
Richard Miller 86e5afc469 Merge branch '2.0' 2012-02-24 09:51:51 +00:00
Richard Miller a3f4c95e9c Changed to only filter truly null value in Transformer 2012-02-14 17:08:38 +00:00
Richard Miller d67cd8f9ba Merge remote-tracking branch 'origin/2.0' 2012-02-03 12:40:42 +00:00
Richard Miller 81bd07a90b Updated identifier field fetching in listener 2012-02-02 19:37:49 +00:00
Richard Miller 1d2887a83b Cleaned up doctrine removal fix changes 2012-01-26 09:59:58 +00:00
Richard Miller 65be0a415e Fixing issue with removing mapped Doctrine entities/documents 2012-01-25 19:51:10 +00:00
Richard Miller dce701b259 Merge branch '2.0'
Conflicts:
	DependencyInjection/FOQElasticaExtension.php
	Manager/RepositoryManager.php
	Resources/config/mongodb.xml
	Resources/config/orm.xml
	Resources/config/propel.xml
2012-01-25 12:09:06 +00:00
Richard Miller e678ce8cc6 Added configuring repository by annotation
Conflicts:

	Manager/RepositoryManager.php
	Resources/config/mongodb.xml
	Resources/config/orm.xml
	Tests/Manager/RepositoryManagerTest.php
2012-01-25 11:20:47 +00:00
Richard Miller adf85973f5 Added tests for logging and data collection 2012-01-13 09:15:03 +00:00
Jeremy Mikola 0d0c653777 Merge pull request #58 from merk/index_transformer
Index wide finder
Conflicts:

	DependencyInjection/FOQElasticaExtension.php
	Resources/config/config.xml
2012-01-12 16:10:28 +00:00
Jeremy Mikola 5f83fd90c2 Merge pull request #51 from willdurand/propel-support
Propel support
Conflicts:

	DependencyInjection/FOQElasticaExtension.php
2012-01-12 16:01:33 +00:00
Richard Miller 96be3159bc Merge branch 'master' of github.com:Exercise/FOQElasticaBundle 2012-01-05 23:03:00 +00:00
Richard Miller 2d1ce1f98a Added tests for Doctrine Listeners 2012-01-05 23:00:53 +00:00
Richard Miller 539bbebdd5 Added tests for Doctrine Listeners 2012-01-05 22:56:16 +00:00
Tim Nagel 9c4ef3d8bd Added finder capability for an index 2012-01-04 09:12:51 +11:00
Richard Miller 231e3a0b06 Moved annotation use back into RepositoryManager 2011-12-24 14:44:37 +00:00
Richard Miller ba976e3a41 Extracted the Doctine specific parts of the Repository Manager 2011-12-23 15:29:01 +00:00
William DURAND 19ae10ae27 Fixed unit test (phpunit doesn\'t allow to expect the base Exception class) 2011-12-20 17:46:36 +01:00
Richard Miller 048b1ff625 Added configuring repository by annotation 2011-12-13 19:26:03 +00:00
Richard Miller 1a921ec2a3 Added Doctrine shortcut names for getting repositories 2011-12-11 23:09:13 +00:00
Richard Miller 98536d3f29 Renamed and moved repository manager 2011-12-11 20:14:00 +00:00
Richard Miller 587d1e540e Added checking the transformed values to test 2011-12-05 21:44:12 +00:00
Jeremy Mikola 2b0e09f3da Merge pull request #38 from richardmiller/adding_repositories_for_encapsulating_queries
Adding manager that returns Doctrine style repositories
2011-11-14 08:18:14 -08:00
Jeremy Mikola 872b597e5b Merge pull request #37 from richardmiller/updated_object_persister_unit_test
Updated ObjectPersisterTest to reflect change in ObjectPersister object
2011-11-14 08:12:54 -08:00
Richard Miller 7dbc4221ae Adding manager that returns Doctrine style repositories 2011-11-12 21:10:00 +00:00
Richard Miller e38d7f3bc5 Updated ObjectPersisterTest to reflect change in ObjectPersister object 2011-11-12 20:09:48 +00:00
Richard Miller 781bf869dc Updated ReseterTest to match current Reseter class 2011-11-12 20:05:54 +00:00
Leszek 1232e4f86c Merge branch 'add-tests' of github.com:l3l0/ElasticaBundle into add-tests
Conflicts:
	Tests/PopulatorTest.php
	Tests/ReseterTest.php
2011-07-28 23:04:21 +02:00
Leszek b06c268f05 Added Object Persister Test. Made test skipped when elastica library classes are not found. 2011-07-28 22:37:54 +02:00
Leszek c430aeaea1 Added test for MappingRegistry Populator and ModelToElasticaAutoTransformer. Extend Populator 2011-07-28 21:56:58 +02:00
Leszek 3896ffd9ff Added IndexManager test 2011-07-28 21:56:58 +02:00
Leszek 1c5f63d560 Fixed indentations 2011-07-28 21:56:58 +02:00
Leszek 4d49c5f311 Added Reseter tests 2011-07-28 21:56:58 +02:00
Leszek d046271690 Added Populator test 2011-07-28 21:56:58 +02:00
Leszek b6d643b809 Added IndexManager test 2011-07-07 23:42:03 +02:00
Leszek f627645481 Fixed indentations 2011-07-07 22:58:43 +02:00
Leszek d261ee2d0f Added Reseter tests 2011-07-07 22:42:03 +02:00
Leszek 4dcd011781 Added Populator test 2011-07-07 22:41:46 +02:00