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

Data Loss in Time Range Query - Unable to Retrieve Newly Created Data for a Specific Date #916

Open
Joe-rise opened this issue Aug 17, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@Joe-rise
Copy link

I am experiencing an issue with the time range query functionality in our application. When performing a query to retrieve data created after a certain timestamp, I am unable to fetch any newly created data for the current day.

Steps to Reproduce:

  1. Create a new data entry with a timestamp set to today.
  2. Use the time range query to retrieve data created after a specific date.
  3. Execute the following request:
{
    "query": {
        "bool": {
            "must": [
                {
                    "range": {
                        "create_time": {
                            "gte":"2023-08-16 00:30:12",
                            "format":"2006-01-02 15:04:05"
                        }
                    }
                }
            ]
        }
    },
    "from": 0,
    "size": 10
}
  1. Observe the results.

Expected Behavior:
The query should return all data entries created on the current day, as the timestamp constraint is set to include today's date.

Actual Behavior:
The query fails to retrieve any data entries created on the current day. It only returns data from previous days, excluding the newly created data for today.

Additional Information:

  • The issue can be reproduced consistently.
  • The provided query structure and constraints have been verified.
  • Other types of queries (e.g., by user, by category) do not exhibit this issue.
  • The application version is 0.4.7, built on commit hash 4885180 on branch 0, with a build date of 2023-06-16T04:41:42Z.

Please let me know if any further information or clarification is required to investigate and resolve this issue.

@hengfeiyang
Copy link
Contributor

hengfeiyang commented Aug 17, 2023

image
With start and end time, i got two records.

image

Only with start time, I only got one record.

Maybe this is a bug.

Please notice: it can't get the data of the current day.

@hengfeiyang hengfeiyang added the bug Something isn't working label Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants