Hi,
I am trying to add a date modified range query to this API call below:
search_result = gis.content.search(query=modified:DATERANGE, item_type="Feature Service", sort_field="modified", sort_order="desc", max_items=5000)
I have tested the query="title:NAMEOFLAYER" and it works fine. But I cant get the right syntax for the query=modified:
I have tried the above syntax, plus these: query="modified [1577840400 TO 1609455600]", query=modified 1577840400 TO 1609455600, query='modified [1577840400 TO 1609455600]'
I cant find any examples of the right syntax for this to work.
Thanks for any help in advance.
Andrew
Solved! Go to Solution.
Hi Andrew Thompson,
You are just missing 3 zeros in front of the UNIX times and also double quotation marks.
Your code has to be as follows:
search_result = gis.content.search(query="modified:[1577840400000 TO 1609455600000]", item_type="Feature Service", sort_field="modified", sort_order="desc", max_items=5000)
Hi Andrew Thompson,
You are just missing 3 zeros in front of the UNIX times and also double quotation marks.
Your code has to be as follows:
search_result = gis.content.search(query="modified:[1577840400000 TO 1609455600000]", item_type="Feature Service", sort_field="modified", sort_order="desc", max_items=5000)