Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix LIMIT_UNLIMITED type issue #140

Merged
merged 3 commits into from
Nov 27, 2023
Merged

Fix LIMIT_UNLIMITED type issue #140

merged 3 commits into from
Nov 27, 2023

Conversation

bckpff
Copy link
Contributor

@bckpff bckpff commented Nov 16, 2023

This fixes a type issue with the \Pimcore\Bundle\EcommerceFrameworkBundle\IndexService\ProductList\ElasticSearch\AbstractElasticSearch::LIMIT_UNLIMITED constant.

The external setter for the limit only accepts integer values thus preventing the use of the elastic scroll api and limiting result sets to 10.000 (default configuration) or the value max_result_window.

I have read the CLA Document and I hereby sign the CLA

@dvesh3 dvesh3 added the Bug label Nov 21, 2023
@dvesh3 dvesh3 added this to the 1.0.7 milestone Nov 21, 2023
@kingjia90 kingjia90 self-assigned this Nov 22, 2023
@kingjia90 kingjia90 changed the base branch from 1.x to 1.0 November 22, 2023 09:14
@kingjia90

This comment was marked as resolved.

@kingjia90 kingjia90 changed the base branch from 1.0 to 1.x November 22, 2023 09:48
@kingjia90
Copy link
Contributor

kingjia90 commented Nov 22, 2023

Having some doubts on a bigger picture:

@bckpff
Copy link
Contributor Author

bckpff commented Nov 23, 2023

was unlimited intentionally introduced to have a different behavior from -1 WITHOUT this scroll request?

I don't see the use case for that. Elasticsearch discourages fetching result sets with size (+ offset) > max_result_window and explicitly states to use the scroll API (or better the search_after method: https://www.elastic.co/guide/en/elasticsearch/reference/current/paginate-search-results.html#search-after)

Maybe add a setter and getter for the doScrollRequest Property?

@kingjia90 kingjia90 removed this from the 1.0.7 milestone Nov 23, 2023
Copy link

github-actions bot commented Nov 27, 2023

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@fashxp
Copy link
Member

fashxp commented Nov 27, 2023

@kingjia90 I think proposed solution is fine and should not do any harm.

@bckpff could you please once more add a comment to sign the CLA ... not sure if it works already in PR description. thank you very much.

@bckpff
Copy link
Contributor Author

bckpff commented Nov 27, 2023

I have read the CLA Document and I hereby sign the CLA

@kingjia90
Copy link
Contributor

kingjia90 commented Nov 27, 2023

@kingjia90 I think proposed solution is fine and should not do any harm.

There's a potential bc-break in the native parameter type, if they passed unlimited as string is going to crash, we never deprecated it nor mentioned in the upgrade notes, it's more to consider that the PHPDoc (only int) was wrong.

Probably could refactor by removing the constant, and just stick with if ($limit > 0) or so to keep it simpler.

@fashxp
Copy link
Member

fashxp commented Nov 27, 2023

@kingjia90 I think proposed solution is fine and should not do any harm.

There's a potential bc-break in the native parameter type, if they passed unlimited as string is going to crash, we never deprecated it nor mentioned in the upgrade notes, it's more to consider that the PHPDoc (only int) was wrong.

Probably could refactor by removing the constant, and just stick with if ($limit > 0) or so to keep it simpler.

But that bc break already happened with Pimcore 11.0 right?
So in Pimcore 11 it never worked so far (neither with the constant nor with a custom string). And we're fixing it now at least for the case when you used the constant.

@kingjia90
Copy link
Contributor

ah ok, got it, then merging soon

@kingjia90 kingjia90 added this to the 1.0.8 milestone Nov 27, 2023
@kingjia90 kingjia90 changed the base branch from 1.x to 1.0 November 27, 2023 15:43
@kingjia90 kingjia90 merged commit ef898cf into pimcore:1.0 Nov 27, 2023
7 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants