Incorrect search result using date parameter
I'm doing a search to count the number of messaes for a certain period of time. I am using the method as specified in this previous question:
This is the format of the query that I used:
"http://forums.autodesk.com/restapi/vc/categories/id/2004/boards/id/101/search/messages/count?q=date%3A%5B" + start + "%20TO%" + end + "%5D&collapse_discussion=false"
Im querying this from java and I keep modifying the start and end date to get the weekly trend of number of posts.
However the result that I get is totally different than the ones I get from the administrator page. This is the result that I get from my query
Now is 2014-06-20
Total of messages on this week : 110
Now is 2014-06-13
Total of messages on this week : 203
Now is 2014-06-06
Total of messages on this week : 342
Now is 2014-05-30
Total of messages on this week : 429
Now is 2014-05-23
Total of messages on this week : 530
Now is 2014-05-16
Total of messages on this week : 631
Now is 2014-05-09
Total of messages on this week : 753
Now is 2014-05-02
Total of messages on this week : 866
Now is 2014-04-25
Total of messages on this week : 934
Now is 2014-04-18
Total of messages on this week : 1049
Since the number keeps increasing while the starting date is getting older, I suspect that the date parameters to limit the search result does not work properly.
Any thoughts on where I went wrong?
Thank you!
Hi nicolasdarmadja ,
your query for the ending date is wrong. it should be
start + "%20TO%20" + end + "%5D&collapse_discussion=false"
the query in fact is "q=date:[START_TIME TO END_TIME]", and with URL escape (http://www.w3schools.com/tags/ref_urlencode.asp),
the empty space(" ") goes to "%20", which is in front and after the "TO"