# Bug on Search in associated collections

**URL:** <https://community.forestadmin.com/t/bug-on-search-in-associated-collections/1422>\
**Category:** Help me!\
**Created:** [December 3, 2020, 3:31pm UTC](https://community.forestadmin.com/t/bug-on-search-in-associated-collections/1422 "2020-12-03T15:31:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Louis-Marie](https://avatars.discourse-cdn.com/v4/letter/l/258eb7/32.png) [@Louis-Marie](https://community.forestadmin.com/u/Louis-Marie)\
**Post date:** [December 3, 2020, 3:31pm UTC](https://community.forestadmin.com/t/bug-on-search-in-associated-collections/1422/1 "2020-12-03T15:31:51Z")

</div>

Hi team,

I have discovered a bug that I can reproduce easily.

Try this please:

- display a collection that has associated one to many relations
- access one associated relation that has more than one page of rows
- When staying on the 1st page, the search bar is running fine
- When navigating to another page, then using the search bar, it does not work any more.

Please have a look at the following video: it shows how it works on the first page of transactions, and how it does not find any result when looking for the same string, if the search is operated from the 2nd page.

Thanks in advance for your help.

Here is my setup

```javascript
    "database_type": "postgres",
    "liana": "forest-express-sequelize",
    "liana_version": "6.3.15",
    "engine": "nodejs",
    "engine_version": "12.13.1",
    "framework": "express",
    "framework_version": "^4.17.1",
    "orm_version": "5.22.3"

```

---

<div class="post-metadata">

**Author:** ![anon94532230](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@anon94532230](https://community.forestadmin.com/u/anon94532230)\
**Post date:** [December 3, 2020, 4:03pm UTC](https://community.forestadmin.com/t/bug-on-search-in-associated-collections/1422/2 "2020-12-03T16:03:10Z")

</div>

Hi @Louis-Marie !  
Thanks for your post 🙂 I tried to reproduce but couldn’t 🧐  
Do you have any error in your logs ?

---

<div class="post-metadata">

**Author:** ![Louis-Marie](https://avatars.discourse-cdn.com/v4/letter/l/258eb7/32.png) [@Louis-Marie](https://community.forestadmin.com/u/Louis-Marie)\
**Post date:** [December 3, 2020, 4:28pm UTC](https://community.forestadmin.com/t/bug-on-search-in-associated-collections/1422/3 "2020-12-03T16:28:28Z")

</div>

Hi @anon94532230

No, there is no error.

But I think I may have found it.

The query sent to my server when trying to search from page 2 is the following (I reduced it a bit):

```javascript
https://..../forest/users/e464f019-b729-4904-961b-acb127656e48/relationships/transactions?fields%5Btransactions%5D=type%2Ccreated_at%2Clabel%2Cterm_city%2Ccredit%2Cdebit%2Ccurrency%2Cfees%2Ccurrency_fee%....%5D=RecipientInfo&fields%5Buser%5D=fullname&fields%5Bcard%5D=CHID_and_status&fields%5Bdevice_detail%5D=device_id&fields%5Buser_ip_log%5D=ip&page%5Bnumber%5D=2&page%5Bsize%5D=20&timezone=Europe%2FParis&sort=-created_at&search=testeur&searchExtended=0

```

You can see that the “page%5Bnumber%5D=2” parameter is passed.

But the count query is returning only 9 rows, so it cannot serve the 2nd page when there is 20 rows per page.  
From my point of view, the search query in the first search occurrence, should not ask for the page number of origin.

Hoping this will help.

---

<div class="post-metadata">

**Author:** ![anon94532230](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@anon94532230](https://community.forestadmin.com/u/anon94532230)\
**Post date:** [December 3, 2020, 4:31pm UTC](https://community.forestadmin.com/t/bug-on-search-in-associated-collections/1422/4 "2020-12-03T16:31:04Z")

</div>

Thanks for figuring this out ! 👍  
I’ll create a ticket right away 🙂

---

<div class="post-metadata">

**Author:** ![anon90145840](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@anon90145840](https://community.forestadmin.com/u/anon90145840)\
**Post date:** [January 26, 2021, 9:26am UTC](https://community.forestadmin.com/t/bug-on-search-in-associated-collections/1422/5 "2021-01-26T09:26:12Z")

</div>

Hello @Louis-Marie!

The fix for the issue was released several days ago 🚀

Could you please test it on your end and confirm that now everything works as expected?

Thank you

---

<div class="post-metadata">

**Author:** ![Louis-Marie](https://avatars.discourse-cdn.com/v4/letter/l/258eb7/32.png) [@Louis-Marie](https://community.forestadmin.com/u/Louis-Marie)\
**Post date:** [January 26, 2021, 1:22pm UTC](https://community.forestadmin.com/t/bug-on-search-in-associated-collections/1422/6 "2021-01-26T13:22:51Z")

</div>

Hi @anon90145840

I confirm that this issue is solved now.

Thanks.
