# Bug OP-7746 - Search autocompleter n+1 loads schemas -> slow

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-7746

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | High |
| Module |  |
| Target versions | 11.3.1 |
| Observed in versions |  |
| Sprint | 11.3.1 |
| Backlog bucket |  |
| Bug found in version (deprecated) |  |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### **Steps to reproduce:**

1.  Open the network tab of the development console
2.  Use the search autocompleter of openproject

### **Actual Behavior**

For every combination of project and type, a work package schema is loaded in an individual request.

<figure class="image"><img src="/api/v3/attachments/19379/content"></figure>

The results are only displayed once the schemas are all loaded, which is slower than necessary.

### **Expected Behavior**

The work package collection returned when filtering already contains the schemas (`_embedded/schemas`). Those need to be sent to the appropriate states in the frontend which will speed up the autocompleter.
