Reduce payload size when searching
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3577958. --> Reported by: [jelleglebbeek](https://www.drupal.org/user/3729474) Related to !26 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Currently the API request that is used when searching or performing a More Like This search returns a lot of data. Things like content of the chunk or document are returned while that's not needed at all. This means the request takes longer and eats more bandwidth for no reason.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>Setup a view with a Vragen.ai SAPI index. Load the view and inspect the API response coming from Vragen.ai.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Pass a field query parameter so we receive only the fields we need from the API, this is supported by JSON:API's <a href="https://jsonapi.org/format/#fetching-sparse-fieldsets">sparse fieldsets</a>.</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <p>None</p> <h3 id="summary-ui-changes">User interface changes</h3> <p>None</p> <h3 id="summary-api-changes">API changes</h3> <p>Adds an additional query parameter to requests from the Document client.</p> <h3 id="summary-data-model-changes">Data model changes</h3> <p>None</p>
issue