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

Indexing a field to use in the default sort of the occurrence search api #1121

Open
marcos-lg opened this issue Feb 28, 2025 · 1 comment
Open
Assignees

Comments

@marcos-lg
Copy link
Contributor

Our occurrence search api uses this sort as default when the q parameter is not sent:

"sort": [
        {
            "year": {
                "order": "desc"
            }
        },
        {
            "month": {
                "order": "asc"
            }
        },
        {
            "id": {
                "order": "asc"
            }
        }
    ]

Queries with no filter but this sort appear quite often in the ES slow query logs. Therefore, it's worth testing an alternative that index a field with a calculated value for the year-month-id combination and use it to sort in the occurrence search api.

@MortenHofft if HPs or other UIs use some other default sorting I can also include it.

@marcos-lg marcos-lg self-assigned this Feb 28, 2025
@marcos-lg marcos-lg changed the title Indexing a field to use in the default sort of the api Indexing a field to use in the default sort of the occurrence search api Feb 28, 2025
@MortenHofft
Copy link
Member

HPs curently do year, month, day, gbifId if there are no q param. I can adapt that to fit the API if needed

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