# Search by orderNumber

**URL:** <https://forum.shopware.com/t/search-by-ordernumber/71222>\
**Category:** Programming (EN)\
**Created:** [27. November 2020 um 19:13 UTC](https://forum.shopware.com/t/search-by-ordernumber/71222 "2020-11-27T19:13:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bitsiam](https://avatars.discourse-cdn.com/v4/letter/b/8edcca/32.png) [@Bitsiam](https://forum.shopware.com/u/Bitsiam)\
**Post date:** [27. November 2020 um 19:13 UTC](https://forum.shopware.com/t/search-by-ordernumber/71222/1 "2020-11-27T19:13:19Z")

</div>

Hi,

I am trying to use the orderNumber instead of the orderId to search for orders.

I tried something like

```
$criteria->addFilter(new EqualsFilter('orderNumber', 10010));
$transactions = $this->orderRepository->search($criteria, $context);

```

but it does not work as expected:&nbsp;“Field “orderNumber” in entity “order\_transaction”&nbsp;was not found.”

Could someone please advise?

---

<div class="post-metadata">

**Author:** ![Shopwarian](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/shopwarian/32/12844_2.png) [@Shopwarian](https://forum.shopware.com/u/Shopwarian)\
**Post date:** [22. März 2021 um 08:57 UTC](https://forum.shopware.com/t/search-by-ordernumber/71222/2 "2021-03-22T08:57:54Z")

</div>

> [@Bitsiam](#):
>
> `$criteria->addFilter(new EqualsFilter('orderNumber', 10010));`

I think you are using the wrong repository - namely order\_transaction instead of order. You have probably messed up the order of service injections (including the repositories) in your services.xml file and in your class constructor.
