Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fix FullTextSearch if property is null #452

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from

Conversation

elyanory
Copy link

@elyanory elyanory commented Dec 2, 2024

Hello !

I'm currently using sulu 2.5.22 in production which uses your bundle. When I try to do a fullTextSearch on a :

$queryBuilder->andWhere(
    $this->qomFactory->fullTextSearch(
        selectorName: 'node',
        propertyName: null,
        fullTextSearchExpression: $filters['search_term']
    )
);

This doesn't work. However, when I look at the documentation, we can set the propertyName to null to search the entire node, but this doesn't work because https://github.com/jackalope/jackalope-doctrine-dbal/blob/2.x/src/Jackalope/Transport/DoctrineDBAL/Query/QOMWalker.php#L827 doesn't accept a null property, or at least it doesn't work with MySQL.

Here's a fix that works for me. Don't hesitate to send me feedback. I haven't taken the time to add the tests yet.

Copy link
Member

@dbu dbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for looking into this! it looks plausible and seems to make sense.

to be sure the functionality works, and to double-check behaviour with jackrabbit, could you add a test case to https://github.com/phpcr/phpcr-api-tests ? (as this is phpcr spec behaviour, the functional test is enough, i don't see need for an additional unit test in this repository)

it should be failing with this repo but hopefully works with jackrabbit already, and would then be fixed by this merge request.

src/Jackalope/Transport/DoctrineDBAL/Query/QOMWalker.php Outdated Show resolved Hide resolved
@dbu
Copy link
Member

dbu commented Dec 12, 2024

can you add the phpcr-api-tests test case for full text search on the whole node?

i would only get to that sometime next week.

@elyanory
Copy link
Author

can you add the phpcr-api-tests test case for full text search on the whole node?

If I have time, I'll try to do it ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants