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

"Error: Call to a member function setName() on null" - on partial word search #3359

Closed
mazurekiza opened this issue Aug 30, 2024 · 1 comment · Fixed by #3366
Closed

"Error: Call to a member function setName() on null" - on partial word search #3359

mazurekiza opened this issue Aug 30, 2024 · 1 comment · Fixed by #3366
Assignees
Labels

Comments

@mazurekiza
Copy link

Preconditions

Magento Version : 2.4.7-p1

ElasticSuite Version : 2.11.8.3

Environment : developer and production mode

Steps to reproduce

  1. Set configuration for search fuzziness and phonetic to No.
    image
  2. On search, try to search by part of the word. Example: full word is "jadalnia", part of word to search is "jada".
    image

Expected result

  1. Search result page with info "No exact results found for: '%1'. The displayed items are the closest matches." should be rendered.

Actual result

  1. Error is displayed/logged into the file:
    Error: Call to a member function setName() on null in /var/www/html/vendor/smile/elasticsuite/src/module-elasticsuite-core/Search/Request/Query/Fulltext/QueryBuilder.php:88

Additional info

In class vendor/smile/elasticsuite/src/module-elasticsuite-core/Search/Request/Query/Fulltext/QueryBuilder.php:87 the $query variable is set as null because \Smile\ElasticsuiteCore\Search\Request\Query\Fulltext\QueryBuilder::getSpellcheckedQuery can and it returns null in case fuzzy and phonetic search are disabled.

@rbayet rbayet self-assigned this Sep 3, 2024
@rbayet rbayet added bug priority Priority labels Sep 3, 2024
rbayet added a commit to rbayet/elasticsuite that referenced this issue Sep 3, 2024
rbayet added a commit that referenced this issue Sep 3, 2024
…s-phonetic-disabled

[Core] Fixes #3359 Query name set error if fuzziness and phonetic disabled
@rbayet rbayet closed this as completed in 9d71de0 Sep 3, 2024
@rbayet
Copy link
Collaborator

rbayet commented Sep 3, 2024

Thanks @mazurekiza for pointing out this bug and the detailed report.

This has been fixed in PR #3366 and merged on 2.11.x
Will ship in the next release.

Regards

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

Successfully merging a pull request may close this issue.

2 participants