Add date restriction

10 views
Skip to first unread message

verscph

unread,
Jan 18, 2008, 7:26:09 AM1/18/08
to Google AJAX API
Hi,

Using Google AJAX Search API, is there a way to add a date restriction
to limit the search results to, lets say, the pages that changed over
the last 24 hours?

Using the standard CSE features you can add the parameter "as_qdr" to
your form:
<form action="http://users.telenet.be/philipverschueren"
id="searchbox_009708136784597396674:rep2skbnpvg">
<table>
<tr>
<td>
<input type="hidden" name="cx" value="xxxxx" />
<input type="hidden" name="cof" value="FORID:11" />
<input type="hidden" name="as_qdr" value="d" />
<input type="text" name="q" size="25" />
</td>
<td>
<input type="submit" name="sa" value="Search" />
</td>
</tr>


</table>

</form>


Setting searcher.setQueryAddition("as_qdr=d") gives not the desired
results in Google AJAX API. Is there another way to achieve this date
restriction?



Ben Lisbakken

unread,
Jan 22, 2008, 7:43:48 PM1/22/08
to Google AJAX API
Verscph --

It looks like your problem is that the modifier that you are using
(as_qdr=d) isn't correct. I think you should be using something like
this:
searcher.setQueryAddition("daterange:startdate-enddate");

Here's more information on using the daterange:
http://reviews.cnet.com/4520-10165_7-6206764-2.html

-Ben
Reply all
Reply to author
Forward
0 new messages