Problem/Motivation

See https://git.drupalcode.org/project/search_api_opensearch/-/blob/3.x/src/...

    // Set the size and from parameters.
    $body['from'] = $query->getOption('offset') ?? self::DEFAULT_OFFSET;
    $body['size'] = $query->getOption('limit') ?? self::DEFAULT_LIMIT;

If a query is passed in that has no limit, then a limit of 10 is set. This means that any VBO submission for more than 10 items will only handle 10 items, even though it claims to handle more.

It puzzles me why we would want a limit of 10 on any query that comes in without a limit. Chances are those queries are using a condition of some sort and want to see all results for said condition. If you then add an arbitrary limit of 10, things get funky.

Steps to reproduce

  1. Build a search api view with an opensearch index
  2. Add VBO to said view
  3. Select more than 10 rows
  4. Submit
  5. See that the output only mentions the first 10 being handled

Proposed resolution

Do not set a default limit or offset if they are absent on the original query.

Remaining tasks

Do not set a default limit or offset if they are absent on the original query.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

kristiaanvandeneynde created an issue. See original summary.

kristiaanvandeneynde changed the visibility of the branch 3548663-queryparambuilder-setting-a to hidden.

kristiaanvandeneynde’s picture

Version: 2.3.1 » 3.x-dev

Also present in latest version

kristiaanvandeneynde’s picture

Status: Active » Needs review
kristiaanvandeneynde’s picture

That just moves the problem to Opensearch itself :D

https://docs.opensearch.org/latest/vector-search/ai-search/hybrid-search...

kim.pepper’s picture

Status: Needs review » Needs work

NW for linting failures.

kim.pepper’s picture

Issue tags: +Needs tests
kim.pepper’s picture

Status: Needs work » Reviewed & tested by the community

Seems like a sensible fix. The phpstan errors are because the baseline format has changed slightly so I regenerated it.

  • kim.pepper committed 63f5535d on 2.x
    [#3548663] fix: QueryParamBuilder setting a limit when one is absent...
kim.pepper’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 3.x and 2.x. Thanks!

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.