Tag Filter Decorator
This is advanced topic, for basic usage it is not required. Misused will yield unexpected results.
Tag Query Decorator
This decorator will allow tag-like syntax for query string to filter results along with normal query, or no query at all to just return all documents with specific tag.
To search like that use square brackets. For example to search famous tagged cities starting with word New, following query could be used:
This query could return for example famous New York, but not New Hampshire which is not famous at all.
Tag decorator is optional, so it needs to be added to configuration of Manganel.
At minimum it is required to provide field which contains tags. This field should store comma or space separated values.
Example part of configuration containing
'decorators' = [ SearchCriteria::class => [ ... [ 'class' => TagDecorator::class, 'field' => 'tag' ], ... ];
Example of configuring with EmbeDi (recommended)
$config = [ 'manganel' => [ 'class' => Manganel::class, 'decorators' => [ SearchCriteria::class => [ [ 'class' => TagDecorator::class, 'field' => 'tag' ] ] ] ] ]; EmbeDi::fly()->addAdapter(new ArrayAdapter($config));