When adding a Contains filter to a JsonColumn, the calculated value is json_encoded, so '%search-term%' is encoded to '"%search-term%"'. When this is inserted into the sql query we end up with the following:
WHERE JsonColumn LIKE '\"%search-term%\"'
This is due to the following method inside JsonColumn
public function getTransformIntoRepository()
{
return function ($data) {
return json_encode($data[$this->columnName]);
};
}
Either need to prevent Contains queries from running getTransformedComparisonValueForRepository or by modifying getTransformationIntoRepository to understand if it is transforming for storage or for searching.