Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

Filter not working as expected #96

@mllrmat

Description

@mllrmat

I have a large index of items, and would like to add an access control mechanism for items on properties of individual users. Until now I had this implemented as filters in preprocessSearchQuery(), which was working all right with Version 7.x-1.x
Now I migrated to 7.x-2.x and the filters are not working any more. They just do not get processed.

class SearchApiGroupAccess extends SearchApiAbstractProcessor { 

      public function preprocessSearchQuery(SearchApiQuery $query) {

		$filter = $query->getFilter();

		$groupFilter = $query->createFilter('OR');
				
 		$publicGroupsFilter = $query->createFilter('AND');
 		$publicGroupsFilter->condition('visibility', 'c');
 		$publicGroupsFilter->condition('privacy', 'o');
 		$groupFilter->filter($publicGroupsFilter);

		//more filters are added ...

                $filter->filter($groupFilter);
      }
}

How would you solve such a scenario in the new version?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions