Using SimpleSearch (customPackages) in MODX3

Has anyone used SimpleSearch’s customPackages prop in modx3? I can’t get fully qualified class names to work, and I’m a little confused how it works at all, looking at the source here.

I have this in the customPackages prop:

FileMan\Model\File:name,description:fileman:{core_path}components/fileman/model/:FileMan\Model\File.resource_id = modResource.id

I have also tried

FileMan\\Model\\File:name,description:fileman:{core_path}components/fileman/src/Model/:FileMan\\Model\\File.resource_id = MODX\Revolution\modResource.id, which works a bit better - but it’s throwing Cannot declare class FileMan\Model\File, because the name is already in use in /www/core/components/fileman/src/Model/File.php on line 17.

You don’t have to define “packageName” and “packagePath” if you already added the package in a bootstrap.php file:

[[!SimpleSearch?
    ...
    &customPackages=`Testpackage\Model\Item:field1,field2:::Item.resource_id = modResource.id`
]]

Also, this is the correct Github repository:

The one you linked is outdated.

Sweet, thanks a lot! :slight_smile:

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.