-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
Description
In real world applications it's not uncommon to conditionally index entities. To automate the entire process a good solution to this scenario would be to introduce a new @Search\IndexIf method annotation. When instance of Foo is about to being indexed, we're checking for the existence of the @Search\IndexIf annotation. When the underlying method returns true the entity is indexed, otherwise it's skipped.
Like this:
use Becklyn\SearchBundle\Mapping as Search;
// ...
/**
* @Search\Item()
*/
class Foo implements SearchableEntityInterface
{
// ...
/**
* @Search\IndexIf()
*/
public function getWhetherThisEntityShouldBeIndexedOrNot () : bool
{
return /* condition(s) */;
}
}Reactions are currently unavailable