1 | <?php |
||
30 | class SearchCriteria extends Criteria implements ConditionDecoratorTypeAwareInterface |
||
31 | { |
||
32 | |||
33 | use UniqueModelsAwareTrait; |
||
34 | |||
35 | private $query = ''; |
||
36 | |||
37 | /** |
||
38 | * @var MoreLike|null |
||
39 | */ |
||
40 | private $moreLike = null; |
||
41 | |||
42 | 72 | public function __construct($criteria = null, AnnotatedInterface $model = null) |
|
50 | |||
51 | /** |
||
52 | * @internal This is used by condition decorator |
||
53 | * @return string |
||
54 | */ |
||
55 | 72 | public function getDecoratorType() |
|
59 | |||
60 | /** |
||
61 | * Set type for searching |
||
62 | * @param AnnotatedInterface $model |
||
63 | * @return Criteria|void |
||
64 | */ |
||
65 | 46 | public function setModel(AnnotatedInterface $model) |
|
70 | |||
71 | /** |
||
72 | * Add model to search more types |
||
73 | * @param $model |
||
74 | * @return $this |
||
75 | */ |
||
76 | 46 | public function add($model) |
|
81 | |||
82 | /** |
||
83 | * Perform scored full text search |
||
84 | * @param $query |
||
85 | */ |
||
86 | 41 | public function search($query) |
|
90 | |||
91 | /** |
||
92 | * Fond document similar to provided document(s) or other options |
||
93 | * @param MoreLike $options |
||
94 | */ |
||
95 | 1 | public function moreLike(MoreLike $options) |
|
116 | |||
117 | /** |
||
118 | * @return MoreLike|null |
||
119 | */ |
||
120 | 71 | public function getMoreLike() |
|
124 | |||
125 | 71 | public function getSearch() |
|
129 | |||
130 | } |
||
131 |