Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setSearchScores example
$this
->
refreshIndex
(
)
;
return
$ids
;
}
/** * @depends testIndexing */
public
function
testAndSearch
(
IdsCollection
$ids
)
: void
{
$this
->
setSearchConfiguration
(
true,
[
'name'
]
)
;
$this
->
setSearchScores
(
[
]
)
;
$criteria
=
new
Criteria
(
)
;
$criteria
->
addState
(
Criteria::STATE_ELASTICSEARCH_AWARE
)
;
$criteria
->
setTerm
(
'Aerodynamic Leather'
)
;
$criteria
->
addSorting
(
new
FieldSorting
(
'name', FieldSorting::ASCENDING
)
)
;
$result
=
$this
->productRepository->
searchIds
(
$criteria
, Context::
createDefaultContext
(
)
)
;
/** @var string[] $resultIds */
$resultIds
=
$result
->
getIds
(
)
;