Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8019219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:19:04+00:00 2026-06-04T21:19:04+00:00

I have an index with a time field whose values are like: time: 2012-06-02T12:25:27+02:00

  • 0

I have an index with a time field whose values are like:

time: 2012-06-02T12:25:27+02:00

Then I’m running the following query:

{
  "sort": {
    "time": "desc"
  },
  "query": {
    "query_string": {
      "query": "time:[2012-6-2T12:24:00Z TO 2012-6-2T12:26:00Z]",
      "default_operator": "AND"
    }
  },
  "size": 30
}

That is returning 0 hits, but if I shift the query string by 2 hours then it matches with the records in that time. So, I’m pretty sure this is a time zone problem. Reading the docs I found I can put a “time_zone” : 2 in the query, but…. where should it be placed in the previous query? I tried many options but couldn’t make it work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T21:19:07+00:00Added an answer on June 4, 2026 at 9:19 pm

    You, probably, have seen the “time_zone” parameter in the histogram date facet, which is different from this query. The query_string query doesn’t accept a time_zone parameter. I think the simplest solution here would be replacing “Z” with desired time zone in your query:

    {
      "sort": {
        "time": "desc"
      },
      "query": {
        "query_string": {
          "query": "time:[2012-6-2T12:24:00+02:00 TO 2012-6-2T12:26:00+02:00]",
          "default_operator": "AND"
        }
      },
      "size": 30
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am running a query like the following: db.sales.find({location: LLLA, created_at: {$gt: ISODate('2012-07-27T00:00:00Z')}}). sort({created_at:
I have to index documents containing a 'time' field whose value is an integer
In my Zend Framework app, I have following code: index.php $app_started_time = time(); layout.phtml
I have a field that I am indexing with Lucene like so: @Field(name=hungerState, index=Index.TOKENIZED,
I have an irregular time series contained in xts and separate time index vector
i have two files:(localhost/template/) index.php template.php each time when i create an article(an article
I have found some code on measuring execution time here http://www.dreamincode.net/forums/index.php?showtopic=24685 However, it does
I have a fast running query (sub 1 sec) when I execute the query
I have this XML in T-SQL: <Elements> <Element> <Index>1</Index> <Type>A</Type> <Code>AB</Code> <Time>1900-01-01T10:21:00</Time> </Element> <Element>
I have set up each document with a date field. (keyword) Values stored in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.