Skip to content

Global Search not properly getting search string #2762

Open
@nikhiltri

Description

@nikhiltri

Description

Global Search isn't working for me in Twill 3. I verified that it loops through all the items on the dashboard, but the SQL query that is generated doesn't include a condition for title for any of the models. It is only checking where "[model]"."deleted_at" is null. Looking at the cmsSearch() method in ModuleController, it's using the FreeTextSearch model and setting:

        $searchFilter->queryString($search);
        $searchFilter->searchColumns($fields);
        $searchFilter->searchQuery($query);

The FreeTextSearch model, however, has a condition that requires searchString to not be empty, and that value is never set in cmsSearch(). It gets set by the searchFor() method which never gets called.

Adding:

        $searchFilter->searchFor($search);

Makes global search work as expected for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions