There is no license information available for the latest version (2.1.0) of this package.

package to handle advanced facetted searches

Installs: 8 758

Dependents: 1

Suggesters: 0

Security: 0

Stars: 5

Watchers: 2

Forks: 1

Open Issues: 3



2.1.0 2021-08-03 13:49 UTC


StyleCI Codacy Badge



Basicly it ships a FLUID ViewHelper and the ability to configure that viewHelper heavily, this way we can do advanced searches

You can define:

  • and configure multiple Searches
  • search multiple attributes of a model (uses dynamic query building)
  • Repositories have to implement an interface to be searchable
  • Searches are instantly stored in the user session if the user changes it


This package can be installed via composer.

Please execute:

composer require kaystrobach/visualsearch @dev

Alternativly you can add the following line to your composer.json and execute composer update

	"kaystrobach/visualsearch": "@dev"

Basic Usage

Inclusion in a FLUID Template

To include the viewHelper you include a line like:

<search:widget.search search="KayStrobach_Contact_Institution"/>

This way you define, that students is the key for storing the filter query in the session for later usage and it is the key for configuring the search in the VisualSearch.yaml.

To make it even easier, you can use the partial provided by the package:

<f:render partial="Visualsearch/Search" arguments="{searchName:'KayStrobach_Contact_Institution', institutions:institutions}" contentAs="value">

Make it possible to query your repository

namespace Acme\Project\Domain\Repository;

use KayStrobach\VisualSearch\Domain\Repository\SearchableRepository;
use TYPO3\Flow\Annotations as Flow;

 * @Flow\Scope("singleton")
class StudentRepository extends SearchableRepository {

     * @var string
    protected $defaultSearchName = 'KayStrobach_Contact_Institution';

query the repository in your controller

    public function indexAction() {


to define the search please checkout the visualSearch.yaml file, please use the package kaystrobach/contact as reference.

Advanced Usage

Searching in the Repository by query

In the studentsRepository you can use the following function to get the filtered students:

namespace Acme\Project\Domain\Repository;

/*                                                                        *
 * This script belongs to the TYPO3 Flow package "SBS.LaPo".              *
 *                                                                        *
 *                                                                        */

use KayStrobach\VisualSearch\Domain\Repository\SearchableRepository;
use TYPO3\Flow\Annotations as Flow;
use TYPO3\Flow\Reflection\ObjectAccess;

 * @Flow\Scope("singleton")
class StudentRepository extends SearchableRepository {
	 * @param array $query
	 * @return \TYPO3\Flow\Persistence\QueryResultInterface
	public function findByQuery($query) {
		$queryObject = $this->createQuery();

		$demands = $this->mapperUtility->buildQuery('lapoStudents', $query, $queryObject);

		// move easy filter to the beginning
		array_unshift($demands, $queryObject->lessThan('deleted', 1));

		return $queryObject->execute();

The buildQuery function is currently in a state, where is maybe moved to the SearchableRepository lateron.

Usage in the controller

In a controller you can then use these lines to filter the resultset:

	 * @var \KayStrobach\VisualSearch\Domain\Session\QueryStorage
	 * @Flow\Inject
	protected $queryStorage;

	public function indexAction() {
		$this->view->assign('students', $this->studentRepository->findByQuery($this->queryStorage->getQuery('students')));

Additionally you need to define how the search should do the autocompletition, this is done in Configuration/VisualSearch.yaml please take a look into the example file to get an idea.