-
Notifications
You must be signed in to change notification settings - Fork 25
create indexes at startup rather than when ingesting, add collection index schema #57
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
Conversation
def all_collections(self, **kwargs) -> Collections: | ||
"""Read all collections from the database.""" | ||
base_url = str(kwargs["request"].base_url) | ||
try: | ||
collections = self.client.search( | ||
index="stac_collections", doc_type="_doc", query={"match_all": {}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doc_type is deprecated, and is assumed to be _doc
def item_collection( | ||
self, collection_id: str, limit: int = 10, **kwargs | ||
self, collection_id: str, limit: int = 10, token: str = None, **kwargs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated this signature wrt the ABC
def post_search( | ||
self, search_request: BaseSearchPostRequest, **kwargs | ||
) -> ItemCollection: | ||
def post_search(self, search_request: Search, **kwargs) -> ItemCollection: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated wrt the ABC
session: Session = attr.ib(default=attr.Factory(Session.create_from_env)) | ||
client = ElasticsearchSettings().create_client | ||
|
||
ES_MAPPINGS_DYNAMIC_TEMPLATES = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copied from transactions.py.
}, | ||
} | ||
|
||
ES_COLLECTIONS_MAPPINGS = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a mapping for collections -- same one used in stac-server
Related Issue(s):
Description:
PR Checklist:
pre-commit run --all-files
)make test
)make docs
)