PHP Interface GraphAware\Reco4PHP\Engine\DiscoveryEngine

Inheritance: extends GraphAware\Reco4PHP\Transactional\CypherAware
Afficher le fichier Open project: graphaware/reco4php Interface Usage Examples

Méthodes publiques

Méthode Description
buildScore ( GraphAware\Common\Type\Node $input, GraphAware\Common\Type\Node $item, GraphAware\Common\Result\Record $record, GraphAware\Reco4PHP\Context\Context $context ) : SingleScore Returns the score produced by the recommended item.
defaultScore ( ) : float
discoveryQuery ( GraphAware\Common\Type\Node $input, GraphAware\Reco4PHP\Context\Context $context ) : GraphAware\Common\Cypher\StatementInterface The statement to be executed for finding items to be recommended.
name ( ) : string
produceRecommendations ( GraphAware\Common\Type\Node $input, GraphAware\Common\Result\ResultCollection $resultCollection, GraphAware\Reco4PHP\Context\Context $context ) : Recommendations Returns a collection of Recommendation object produced by this discovery engine.
recoResultName ( ) : string
scoreResultName ( ) : string

Method Details

buildScore() public méthode

Returns the score produced by the recommended item.
public buildScore ( GraphAware\Common\Type\Node $input, GraphAware\Common\Type\Node $item, GraphAware\Common\Result\Record $record, GraphAware\Reco4PHP\Context\Context $context ) : SingleScore
$input GraphAware\Common\Type\Node
$item GraphAware\Common\Type\Node
$record GraphAware\Common\Result\Record
$context GraphAware\Reco4PHP\Context\Context
Résultat GraphAware\Reco4PHP\Result\SingleScore A single score produced for the recommended item

defaultScore() public méthode

public defaultScore ( ) : float
Résultat float The default score to be given to the discovered recommended item

discoveryQuery() public méthode

The statement to be executed for finding items to be recommended.
public discoveryQuery ( GraphAware\Common\Type\Node $input, GraphAware\Reco4PHP\Context\Context $context ) : GraphAware\Common\Cypher\StatementInterface
$input GraphAware\Common\Type\Node
$context GraphAware\Reco4PHP\Context\Context
Résultat GraphAware\Common\Cypher\StatementInterface

name() public méthode

public name ( ) : string
Résultat string The name of the discovery engine

produceRecommendations() public méthode

Returns a collection of Recommendation object produced by this discovery engine.
public produceRecommendations ( GraphAware\Common\Type\Node $input, GraphAware\Common\Result\ResultCollection $resultCollection, GraphAware\Reco4PHP\Context\Context $context ) : Recommendations
$input GraphAware\Common\Type\Node
$resultCollection GraphAware\Common\Result\ResultCollection
$context GraphAware\Reco4PHP\Context\Context
Résultat GraphAware\Reco4PHP\Result\Recommendations

recoResultName() public méthode

public recoResultName ( ) : string
Résultat string The column identifier of the row result representing the recommended item (node)

scoreResultName() public méthode

public scoreResultName ( ) : string
Résultat string The column identifier of the row result representing the score to be used, note that this is not mandatory to have a score in the result. If empty, the score will be the float value returned by defaultScore() or the score logic if the concrete class override the buildScore method.