Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
updateMapping example
$lastBacklogId
=
$this
->backlogReader->
getLastBacklogId
(
)
;
foreach
(
$this
->mappings
as
$mapping
)
{
if
(
!
empty
(
$indexNames
)
&& !\
in_array
(
$mapping
->
getType
(
)
,
$indexNames
)
)
{
continue
;
}
$configuration
=
$this
->indexFactory->
createIndexConfiguration
(
$shop
,
$mapping
->
getType
(
)
)
;
$shopIndex
=
new
ShopIndex
(
$configuration
->
getName
(
)
,
$shop
,
$mapping
->
getType
(
)
)
;
$this
->
createIndex
(
$configuration
,
$shopIndex
)
;
$this
->
updateMapping
(
$shopIndex
,
$mapping
)
;
$this
->
populate
(
$shopIndex
,
$helper
)
;
$this
->
applyBacklog
(
$shopIndex
,
$lastBacklogId
)
;
$this
->
createAlias
(
$configuration
)
;
}
}
/** * Removes unused indices */
public
function
cleanupIndices
(
)
{