Skip to main content
Guides & TutorialsMagentoE-CommerceWeb Development

Column not found: 1054 Unknown column ‘search_result.score’ in ‘order clause’

Apisylux TeamJune 2, 20202 min read

Knowledge map

Article briefing

Published
Guides & Tutorials
Topic category
2 min read
Estimated reading time
Apisylux Team
Author
June 2, 2020
Published
August 14, 2026
Last updated
3
Tags
1
Category
2m
Read Time
1
Next Step
Column not found: 1054 Unknown column ‘search_result.score’ in ‘order clause’
Column not found: 1054 Unknown column ‘search_result.score’ in ‘order clause’ article image
Column not found: 1054 Unknown column ‘search_result.score’ in ‘order clause’ - preserved image from the migrated article.

Overview

You may find this error when using the Porto theme installed and working with either the parent or child theme on Magento.

When you try to search for a product, you may get the following error:

Free Consultation

Need help with Guides & Tutorials?

Get a free strategy session with our experts — no commitment required.

Contact Us

Column not found: 1054 Unknown column ‘search_result.score’ in ‘order clause’.

The query was:

SELECT `e`.*, `stock_status_index`.`stock_status` AS `is_salable`, `price_index`.`price`, `price_index`.`tax_class_id`, `price_index`.`final_price`, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS `minimal_price`, `price_index`.`min_price`, `price_index`.`max_price`, `price_index`.`tier_price`, `cat_index`.`position` AS `cat_index_position` FROM `catalog_product_entity` AS `e` INNER JOIN `cataloginventory_stock_status` AS `stock_status_index` ON e.entity_id = stock_status_index.product_id AND stock_status_index.website_id = 0 AND stock_status_index.stock_id = 1 INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND price_index.customer_group_id = 0 INNER JOIN `catalog_category_product_index_store1` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id='1' AND cat_index.visibility IN(3, 4) AND cat_index.category_id='3' WHERE (stock_status_index.stock_status = 1) ORDER BY `search_result`.`score` desc LIMIT 9

This issue was caused by the file:

Key steps and notes

public_html/app/code/Mageplaza/LayeredNavigation/Model/ResourceModel/Fulltext/Collection.php

A part of the code in that file had been commented out.

$table = $temporaryStorage->storeDocuments($this->searchResult->getItems()); $this->getSelect()->joinInner( [ 'search_result' => $table->getName(), ], 'e.entity_id = search_result.' . TemporaryStorage::FIELD_ENTITY_ID, []
);

This code creates the temporary search_result table. However, if it is commented out, the query will still try to use the following line:

ORDER BY `search_result`.`score` desc

Final notes

Since the search_result table is never joined, Magento throws the error about the missing column.

Removing the comments around this block of code resolved the issue.

Launch readiness

Let's turn your website into a working growth system.

Bring the goal. We'll help shape the offer, interface, lead flow, launch plan, and next actions so your website feels ready for real buyers.

Start Your Project

Project readiness panel

Online

Scope clarity

Discovery ready

Performance plan

Speed-first build

Launch path

Secure deploy

Lead flow

CRM-ready handoff

Free

Consultation

<24h

Response

Clear

Plan

Next action

Share your current website, project goal, and deadline. We'll return with a practical improvement path and first-step estimate.