-
Notifications
You must be signed in to change notification settings - Fork 25
Implement fields extension #129
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
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.
I don't know enough about the elasticsearch side to feel comfortable fully reviewing this -- @philvarner do you have bandwidth to take a look as well?
@gadomski @philvarner The Fields extension code has been copy/ pasted from stac-fastapi-sqlalchemy along with some of the tests. The logic itself doesn't use Elasticsearch. The filtering is done after the results are retrieved from Elasticsearch. |
k if k in Settings.get().indexed_fields else f"properties.{k}" | ||
for k in search_request.query.keys() |
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.
One thing to be aware of here if you plan on eventually supporting Python 3.11 -- Python 3.11 changes the default __str__
implementation for enums, so you may have to define it yourself. See stac-utils/stac-fastapi@c32d5bc#diff-7e6336bc2ad3ff7b065d2980d4d70fb1e5292b8748be4b8ce65d1c61425a7ab8R69-R77 for an example.
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.
Good to know. Maybe now is the time to update
Related Issue(s):
Description:
Implements the Fields extension for GET and POST Search requests. #127 should be reviewed first.
PR Checklist:
pre-commit run --all-files
)make test
)make docs
)