-
Notifications
You must be signed in to change notification settings - Fork 612
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
[4.x]: Ordering search results breaks external search engine implementation #14293
Comments
Can you show me how you are tapping into the search functionality? |
For sure, we've basically forked https://github.com/codemonauts/craft-elasticsearch/ and made minor adjustments. The search component gets registered here: https://github.com/codemonauts/craft-elasticsearch/blob/main/src/Elastic.php#L73 Which makes craft trigger this class when searching: https://github.com/codemonauts/craft-elasticsearch/blob/main/src/services/Search.php#L21. When searching, craft invokes |
Do you have some pointer of where I could look to fix this or change my implementation? |
Just added a new To update to the |
Craft 4.8.0 is out with that change. |
What happened?
Description
A (somewhat) recent change to handling search results breaks our ability to implement ElasticSearch. When ordering search results, the
_applySearchParams()
function (https://github.com/craftcms/cms/blob/develop/src/elements/db/ElementQuery.php#L2771) will callcreateDbQuery()
if ordering on any field except forscore
.We use a custom Search component implementation to use ElasticSearch. As a result there is no database connection or query interface we could provide here. The previous implementation of
_applySearchParams()
didn't require such a connection:cms/src/elements/db/ElementQuery.php
Line 2764 in 2554ddb
It'd be great if we can either disable the new business logic, or if the
_applySearchParams()
could be made public so we can override it.Commit: 4a52ba8
Steps to reproduce
createDbQuery()
isn't implemented and can't be for ElasticSearchExpected behavior
_applySearchParams()
gets overridden by the custom search component and doesn't call the database.Actual behavior
createDbQuery()
isn't implemented and can't be for ElasticSearchCraft CMS version
4.7.1
PHP version
No response
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: