-
Re: API GET request with Multiple parameters
Scott A Johnson Jun 20, 2016 10:08 AM (in response to cennydd.tudor@virginmedia.co.uk)1 person found this helpfulHi Cen,
The easiest way I see to accomplish this would be to use the Place Contents service with the sort parameter, specifying dateCreatedDesc. This will retrieve only content from that place and will not filter, but order the content with the most recently created first. Afterwards making the api call, include some simple logic in your client script to stop reading results once content created after the specified cutoff date is found. You'll potentially read between 1 and 'count' extra content items from the web service call, but those can be thrown away.
It doesn't appear the Search service allows to filter on "create/publish" date. The after and before filters check the last modified times, which may not be what you're looking for.
Hope this helps,
Scott
-
Re: API GET request with Multiple parameters
cennydd.tudor@virginmedia.co.uk Jun 21, 2016 3:27 AM (in response to Scott A Johnson)Hi Scott,
Thanks for the reply. I essentially have in place what you have suggested in terms of a client side script. Looping through the result set and only including the results if they sasitfy the date criteria. Where as this definitely works for now. I'm conscious that as time goes on and more documents are created, it will still have to loop through the enitre result set which in the future could be hundreds if not thousands of documents due to the requirements of the space.So if possible, i'd like to return as close to the data I need as possible.
The "after" filter may be what i'm after, so my question is now, can I filter by both a place id and after date in one search service request?Many thanks,
Cen-
Re: API GET request with Multiple parameters
Scott A Johnson Jun 21, 2016 11:03 AM (in response to cennydd.tudor@virginmedia.co.uk)1 person found this helpfulHi Cen,
If you use the parameter: sort=dateCreatedDesc, the results being returned by the api call should be ordered with most recently created first. You shouldn't need to read all content. Just read each page of content until you reach your cutoff date.
Scott
-
Re: API GET request with Multiple parameters
cennydd.tudor@virginmedia.co.uk Jun 22, 2016 2:40 AM (in response to Scott A Johnson)Hi Scott,
Light bulb just turned on and I understand now.
Many thanks!
Cen
-
-
-