Skip to content

Event for search result manipulation #6551

@mutec

Description

@mutec

It would be good to introduce an event within SearchResultHandler that makes it possible to do some kind of last-minute result processing/filtering based on a custom logic. Filtering results has impact on calculating the number of pages and the pagination mapping itself, so this can't be done by filtering within the search result templates.
Or maybe there's a better way?

Background:
Historically there have been objects using multilingual fields like title and description. That i18n data was stored as a custom language variable instead of an own sub-object (like its done for articles for example).
In order to provide a search implementation an index row was created for each language (if its multilingual) containing the value based on the language. Since the unique key on MySQL-search-tables are build upon objectID and languageID this has always been a possible and valid option to integrate those objects.
The current issue about this is: The search iterates over every single index row and (in case a word e.g. WoltLab is used for two or more languages) returns a list of multiple rows belonging to the same objectID, messing up the list of search results. At this point we (optionally) need to group those matched results by it's objectID before displaying them to the user.
Migrating every package to the usage of objects and language based sub-objects wouldn't be economic for us.
Since I also didn't find any permission checks on object-basis (there's one for the whole search object type and WBB does this by excluding the containers' ids which isn't possible when using permissions per object) I guess it's also possible to find in-accessible content in case it has been indexed.

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