Skip to content

Search suggestions shows error #1254

@sukhwinder33445

Description

@sukhwinder33445

Describe the bug

Image

To Reproduce

  • Use the same filter as in screenshot above.

Additional context

The query tries to join the base table again, which should not be the case.
According to @nilmerg, it is a bug in this code below:

// This had so many iterations, if it still doesn't work, consider removing it entirely :(
if ($searchFilter instanceof Filter\None) {
$query->filter($inputFilter);
} elseif ($searchFilter instanceof Filter\All) {
$searchFilter->add($inputFilter);
// There may be columns part of $searchFilter which target the base table. These must be
// optimized, otherwise they influence what we'll suggest to the user. (i.e. less)
// The $inputFilter on the other hand must not be optimized, which it wouldn't, but since
// we force optimization on its parent chain, we have to negate that.
$searchFilter->metaData()->set('forceOptimization', true);
$inputFilter->metaData()->set('forceOptimization', false);
} else {
$searchFilter = $inputFilter;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    further-investigationFurther investigation required. Cause or solution unknown yet

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions