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

Error: {'errors': ['Page must be an object']} #126

Closed
lsilva01 opened this issue Mar 27, 2022 · 4 comments
Closed

Error: {'errors': ['Page must be an object']} #126

lsilva01 opened this issue Mar 27, 2022 · 4 comments

Comments

@lsilva01
Copy link

The following code throws the error: elastic_transport.exceptions.BadRequestError: [400] {'errors': ['Page must be an object']}

    resp = app_search.search(
        engine_name=os.environ['ENGINE_NAME'],
        body={
            "query": "test"
        },
        params={
            "page": { "size": 100 }
        }
    )

How should the page.size parameter be passed ?

References:
https://www.elastic.co/guide/en/enterprise-search-clients/python/current/app-search-api.html#app-search-search-apis
https://www.elastic.co/guide/en/app-search/current/search.html

@sethmlarson
Copy link
Contributor

@lsilva01 Thanks for opening this, could you provide what version of the elastic-enterprise-search package you're using and the server of the server?

@lsilva01
Copy link
Author

The version is 7.17.0. It was installed via pip https://pypi.org/project/elastic-enterprise-search/ .

The ES Cloud server deployment version is v7.15.2.

@sethmlarson
Copy link
Contributor

From the API documentation for App Search you should pass the {"page": {"size": X}} structure via the body parameter. Closing this as resolved.

@lsilva01
Copy link
Author

Thanks. This worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants