Passing date field throw rest


(abdo) #1

Hi all,

I am using PHP to write REST query to ES .I am trying to search my ES with a
query that contains date field. This is my query:
{"query":{"bool":{"must":{"range":{"timeGenerated":{"from":"2013/4/1
09:14:08","to":"2013/4/1 09:14:08"}}}}}}

When I try this query it gives me no response from server -not empty-. When
I remove the time portion from the date, it works!
{"query":{"bool":{"must":{"range":{"timeGenerated":{"from":"2013/4/1","to":"2013/4/1"}}}}}}

Also I tried the tow queries from curl command line and it works fine.

regards,

--
View this message in context: http://elasticsearch-users.115913.n3.nabble.com/Passing-date-field-throw-rest-tp4035272.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Clinton Gormley) #2

Hi abdo

Check the mapping to see how your date field is mapped, and what date
formats it accepts - that is likely the problem

clint

On 22 May 2013 13:46, abdo abdo.a2008@gmail.com wrote:

Hi all,

I am using PHP to write REST query to ES .I am trying to search my ES with
a
query that contains date field. This is my query:
{"query":{"bool":{"must":{"range":{"timeGenerated":{"from":"2013/4/1
09:14:08","to":"2013/4/1 09:14:08"}}}}}}

When I try this query it gives me no response from server -not empty-. When
I remove the time portion from the date, it works!

{"query":{"bool":{"must":{"range":{"timeGenerated":{"from":"2013/4/1","to":"2013/4/1"}}}}}}

Also I tried the tow queries from curl command line and it works fine.

regards,

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/Passing-date-field-throw-rest-tp4035272.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Hilal) #3

Is the problem solved? I have same issue. If you are solved this problem please help me. How did you solve this problem?


(David Pilato) #4

Hijacking old threads won't help you. Please keep your questions in Date format incorrect results


(system) #5