UPGRADE FROM 1.x to 5.0
Breaking changes
- Removed all deprecations from 1.x version.
- Removed
_ttl
metafield annotation. - Service name
@annotations.cached_reader
changed to@es.annotations.cached_reader
#717 - From Document annotation removed all properties except
type
. From now on everything has to be defined in theoptions
. string
property type was deprecated in elasticsearch 5.0, please usetext
orkeyword
accordingly. More info: https://www.elastic.co/blog/strings-are-dead-long-live-stringsauth
in the configuration was removed. Use authentication information directly in host or create event listener to modify client creation. There are too many ways to authenticate elasticsearch. That said we leaving this customisation to the user due difficult support.connections
node in configuration was removed. Useindex
from now on. There was absolute misunderstanding to have exposed connections, we never saw any benefits to use single connection between several managers.- Changed the namespace of the
DocumentParserException
toONGR\ElasticsearchBundle\Mapping\Exception
. #722 analysis
node inindex
/connection
was deprecated. From now on used analyzers, filters, etc. must be provided in document annotationsResults
(constants container for result type definitions) class was removed in favor for new find functions with predefined types in the names.- Export service now uses own query calling instead of elasticsearch-php. It was changes due a bug in hits iterator in elasticsearch-php. We will try to help them to resolve this issue.
Manager::execute()
was removed. UseManager::search()
instead.Repository::execute()
was removed. UsefindDocuments()
,findArray()
orfindRaw()
instead.Manager::scroll()
third argument with result type definition was removed. Now you can get only raw result data from scroll.AbstractElasticsearchTestCase::runTest()
was removed. It was introduced when elasticsearch in our CI was very unstable. Now there is no sense to repeat failing tests again and again.AbstractElasticsearchTestCase::getNumberOfRetries()
was removed. If you write tests by extendingAbstractElasticsearchTestCase
delete your retries data provides.
Changes which should not impact the functionality
- Minimum PHP required version now is 5.6
- Minimum Symfony required version now is 2.8
- Minimum ES version was upped to 5.0
- Document annotation now has an options support.
- No more needed to define analysis in manager, it will be collected automatically from documents.
UPGRADE FROM 0.x to 1.0
Breaking changes
- All stuffs which were marked as
@deprecated
is removed. - DSL query builder was exposed to standalone ElasticsearchDSL library. So this effects a namespace. Run global search and replace (any modern IDE has this feature) through your project files. Change namespace
ONGR\ElasticsearchDSL\
toONGR\ElasticsearchDSL\
. Client
is now the part of theManager
. So if you had any extensions of using client directly e.g. type hinting then search and remove it or change to theManager
.Manager
andRepository
namespace is changed toService
, there is no moreORM
. Again, run search and replace to find oldONGR\ElasticsearchBundle\ORM\
toONGR\ElasticsearchBundle\Service\
namespace.Results
namespace was completely refactored. TheSuggestion
,RawResultScanIterator
,DocumentScanIterator
,DocumentHighlight
,IndicesResult
were removed.- Events currently are disabled due previous complex integration. They will be introduced back in the v1.1.0.
config.yml
structure lightly was changed. Theanalysis
section appeared where you can define analyzers, filters etc and then reuse them in connections. See configuration chapter for more information.document_dir
option inconfig.yml
was removed. From now onDocument
namespace for ElasticsearchBundle's documents is mandatory.- Removed
createDocument()
fromRepository
class. To create documents use normal object creation way withnew
. - Mapping annotations were simplified. In the
Document
annotationsSkip
andInherit
annotations were removed. InProperty
there are onlytype
,name
andoptions
attributes left. Fields containingObject
andNested
now must be defined usingEmbedded
annotation. From now on all custom fields has to be defined inoptions
(e.g. index_analyzer). See mapping chapter for more info. AbstractDocument
andDocumentInterface
were removed. Now any class with correct annotations can be used as a document.@Id
,@Ttl
,@ParentDocument
annotations were introduced to define Elasticsearch meta-fields like_id
,_ttl
,_parent
.- From now on
Repository
always represents single document. To execute search on multiple types useManager
.
Changes which should not impact the functionality
- Minimum PHP required version now is 5.5
- Minimum Symfony required version now is 2.7
- Document Proxy class was completely removed. This should not effect any functionality.
- Profiler namespace is changed from
DataCollector
toProfiler
. findBy
in the Repository now usesquery_string
query instead of terms query.
If we miss forgot something here in the list, please open an issue or a PR with a suggestion.