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

Add a type NumericTime to make sorting possible without performance tradeoffs #21

Merged
merged 5 commits into from
Jan 8, 2025

Conversation

varfrog
Copy link
Owner

@varfrog varfrog commented Jan 8, 2025

OpenSearch 2.17 indexes "date" fields (even with format=epoch_seconds) as text:

                            "type": "text",
                            "fields": {
                                "keyword": {
                                    "type": "keyword",
                                    "ignore_above": 256
                                }
                            }

Sorting on such a field gives:

Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [<field name>] in order to load field data by uninverting the inverted index. Note that this can use significant memory.

@varfrog varfrog self-assigned this Jan 8, 2025
@varfrog varfrog marked this pull request as draft January 8, 2025 13:46
@varfrog varfrog marked this pull request as ready for review January 8, 2025 13:51
@varfrog varfrog merged commit 8ee374d into main Jan 8, 2025
2 checks passed
@varfrog varfrog deleted the feat/timeEpochSecond branch January 8, 2025 15:52
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

Successfully merging this pull request may close these issues.

2 participants