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

ElasticSearch refresh parameter unused? #315

Open
ccancellieri opened this issue Nov 27, 2024 · 0 comments
Open

ElasticSearch refresh parameter unused? #315

ccancellieri opened this issue Nov 27, 2024 · 0 comments

Comments

@ccancellieri
Copy link

ccancellieri commented Nov 27, 2024

Describe the bug
The pagination does not work properly after massive items upload over ElasticSearch as the number of items should still be calculated by ES (probably).
After a while the number is correct and the pagination starts to work.

I noticed that in the driver we have the support for the refresh parameter correctly exposed but it is never used by the stac-api as it is an abstraction layer while 'refresh' is something specific for ElasticSearch:

F.e.:

    async def delete_item(
        self, item_id: str, collection_id: str, refresh: bool = False
    ):
        """Delete a single item from the database.

        Args:
            item_id (str): The id of the Item to be deleted.
            collection_id (str): The id of the Collection that the Item belongs to.
            refresh (bool, optional): Whether to refresh the index after the deletion. Default is False.

        Raises:
            NotFoundError: If the Item does not exist in the database.
        """
        try:
            await self.client.delete(
                index=index_by_collection_id(collection_id),
                id=mk_item_id(item_id, collection_id),
                refresh=refresh,
            )
        except exceptions.NotFoundError:
            raise NotFoundError(
                f"Item {item_id} in collection {collection_id} not found"
            )

But from the stac-api refresh is never passed. Am I wrong?

Should we hardcode 'wait_for' or at least use the kwargs in some way?

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

1 participant