# API-Request: Column not found: 1054 Unknown column \_score

**URL:** <https://forum.shopware.com/t/api-request-column-not-found-1054-unknown-column-score/98075>\
**Category:** Programmierung\
**Created:** [18. Januar 2023 um 23:16 UTC](https://forum.shopware.com/t/api-request-column-not-found-1054-unknown-column-score/98075 "2023-01-18T23:16:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![silverstallion1985](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/silverstallion1985/32/18228_2.png) [@silverstallion1985](https://forum.shopware.com/u/silverstallion1985)\
**Post date:** [18. Januar 2023 um 23:16 UTC](https://forum.shopware.com/t/api-request-column-not-found-1054-unknown-column-score/98075/1 "2023-01-18T23:16:54Z")

</div>

Hallo liebe Shopware-Community,

ich habe da ein Problem beim API-Request, folgender Fehler ist mir bis jetzt bei den endpoints [http://localhost:8000/api/order](http://localhost:8000/api/order) und [http://localhost:8000/api/order-delivery](http://localhost:8000/api/order-delivery) aufgefallen, hier als Beispiel endpoint api/order-delivery:  
 ![order-delivery](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/3X/6/4/64dfca5c098e777447e583e7e1bf8d0851efad78.png)

500 Server Error: Internal Server Error for url: [https://meine-domain.de/api/order-delivery?limit=10&page=1&associations[shippingOrderAddress][limit]=10&associations[shippingOrderAddress][page]=1&associations[shippingOrderAddress][associations][country][limit]=10&associations[shippingOrderAddress][associations][country][page]=1&associations[shippingOrderAddress][associations][country][term]=1&associations[shippingOrderAddress][associations][country][total\_count\_mode]=None&associations[shippingOrderAddress][term]=1&associations[shippingOrderAddress][total\_count\_mode]=None&associations[order][limit]=10&associations[order][page]=1&associations[order][associations][lineItems][limit]=10&associations[order][associations][lineItems][page]=1&associations[order][associations][lineItems][term]=1&associations[order][associations][lineItems][total\_count\_mode]=None&associations[order][term]=1&associations[order][total\_count\_mode]=None&filter[0][type]=equals&filter[0][field]=order.stateMachineState.technicalName&filter[0][value]=in\_progress&term=1&total\_count\_mode=None](https://meine-domain.de/api/order-delivery?limit=10&page=1&associations%5BshippingOrderAddress%5D%5Blimit%5D=10&associations%5BshippingOrderAddress%5D%5Bpage%5D=1&associations%5BshippingOrderAddress%5D%5Bassociations%5D%5Bcountry%5D%5Blimit%5D=10&associations%5BshippingOrderAddress%5D%5Bassociations%5D%5Bcountry%5D%5Bpage%5D=1&associations%5BshippingOrderAddress%5D%5Bassociations%5D%5Bcountry%5D%5Bterm%5D=1&associations%5BshippingOrderAddress%5D%5Bassociations%5D%5Bcountry%5D%5Btotal_count_mode%5D=None&associations%5BshippingOrderAddress%5D%5Bterm%5D=1&associations%5BshippingOrderAddress%5D%5Btotal_count_mode%5D=None&associations%5Border%5D%5Blimit%5D=10&associations%5Border%5D%5Bpage%5D=1&associations%5Border%5D%5Bassociations%5D%5BlineItems%5D%5Blimit%5D=10&associations%5Border%5D%5Bassociations%5D%5BlineItems%5D%5Bpage%5D=1&associations%5Border%5D%5Bassociations%5D%5BlineItems%5D%5Bterm%5D=1&associations%5Border%5D%5Bassociations%5D%5BlineItems%5D%5Btotal_count_mode%5D=None&associations%5Border%5D%5Bterm%5D=1&associations%5Border%5D%5Btotal_count_mode%5D=None&filter%5B0%5D%5Btype%5D=equals&filter%5B0%5D%5Bfield%5D=order.stateMachineState.technicalName&filter%5B0%5D%5Bvalue%5D=in_progress&term=1&total_count_mode=None) : {„errors“:[{„code“:„0“,„status“:„500“,„title“:„Internal Server Error“,„detail“:„An exception occurred while executing \u0027SELECT LOWER(HEX(`order`.id)) as id, LOWER(HEX(child.id)) as child\_id FROM `order` `order` LEFT JOIN (SELECT @n:=IF(@c=`order_line_item`.`order_id`, @n+1, IF(@c:=`order_line_item`.`order_id`,1,1)) as id\_count, `order_line_item`.`order_id`, `order_line_item`.id, \_score as sort\_0 FROM `order_line_item` WHERE (`order_line_item`.`version_id` = ?) AND ((`order_line_item`.`order_id` IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?))) HAVING \_score \u003E= ? ORDER BY MIN(`order_line_item`.`order_id`) ASC, \_score DESC) child ON child.order\_id = `order`.id AND id\_count \u003E= ? AND id\_count \u003C= ? WHERE `order`.id IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\u0027 with params […]:\n\nSQLSTATE[42S22]: Column not found: 1054 Unknown column \u0027\_score\u0027 in \u0027field list\u0027“,„meta“:{„trace“: …

in diesem fall habe ich der order-delivery eine association(‚order‘) angehängt an die association(‚order‘) habe ich association(‚lineItems‘) angehängt. Dabei wird mir auf der Gegenstelle (api/order-delivery) dann eine SQL-Abfrage generiert mit der column \_sort, die aber in der order\_delivery Tabelle nich exestiert.

Lass ich jetzt aber die association(‚lineItems‘) weg, funktioniert die abfrage wunderbar.  
Wenn ich die gleiche abfrage im storefront prüfe, funktioniert die abfrage auch, allerdings wird dabei dann eine SQL-Abfrage ohne die \_sort spalte generiert

ich hoffe ich habe einigermaße verständlich mein problem erläutert. Hatte von euch auch schon jemand was ähnliches? Ich wäre froh über jede Hilfe, Danke!
