小编Anu*_*wal的帖子

Google自定义搜索排序日期范围标准不起作用

在Google自定义搜索中,我们在sort参数中传递日期范围条件

http://www.example.com/search?cx=xxxxxxxxxxxxxxxxxxxxx:yyyyyy_yyyyy&q=google&sort=date:r:20160304:20160505.
https://developers.google.com/custom-search/docs/structured_search#restrict_to_range
Run Code Online (Sandbox Code Playgroud)

但是我们没有按照日期范围标准获得预期结果.调试代码后,即使我们将sort参数传递给我们的搜索页面网址,也不会将sort参数传递给自定义搜索网址.

Google自定义搜索网址:

https://cse.google.com/cse?q=google&r=m&cx=xxxxxxxxxxxxxxxxxxxxx:yyyyyy_yyyyy&fexp=20606&client=google-coop&hl=en&type=0&oe=UTF-8&ie=UTF-8&format=p4&ad=p4&nocache=1081472127237880&num=0&output=uds_ads_only&source=gcsc&v=3&allwcallad=1&adext=as1%2Csr1%2Cctc1&bsl=10&u_his=50&u_tz=330&dt=1472127237882&u_w=1366&u_h=768&biw=1349&bih=233&psw=1349&psh=233&frm=0&uio=uv3st16sd13sv13lhsl1sr1cc1-&jsv=14100&rurl=http%3A%2F%2Fwww.example.com%2Fsearch%3Fcx%xxxxxxxxxxxxxxxxxxxx_yyyyy%26q%3Dgoogle%26sort%3Ddate%253Ar%253A20160304%253A20160505
Run Code Online (Sandbox Code Playgroud)

但是当我们尝试使用排序日期范围参数访问直接API时,我们得到了预期的结果.

https://www.googleapis.com/customsearch/v1?q=google&cx=xxxxxxxxxxxxxxxxxxxxx:yyyyyy_yyyyy&sort=date%3Ar%3A20160701%3A20160724&key=<APIKEY>
Run Code Online (Sandbox Code Playgroud)

我们正在使用Google自定义搜索V2实施.

谢谢,Anup

javascript api search google-custom-search

29
推荐指数
1
解决办法
772
查看次数

PDF格式的HTML5画布渲染

如何在HTML5画布中呈现PDF?

我想出了pdf.js脚本https://github.com/mozilla/pdf.js.但似乎这个项目仍处于开发阶段.

pdf html5 pdf.js

9
推荐指数
1
解决办法
1万
查看次数

Slickgrid列宽应根据最宽的行内容自动调整大小

在Slickgrid中,有没有什么方法可以根据最宽的行内容自动调整列宽?

在示例示例中,我可以看到列的值为列字段的硬编码http://mleibman.github.com/SlickGrid/examples/example2-formatters.html

var columns = [
    {id: "title", name: "Title", field: "title", width: 120, cssClass: "cell-title", formatter: formatter},
    {id: "duration", name: "Duration", field: "duration"},
    {id: "%", name: "% Complete", field: "percentComplete", width: 80, resizable: false, formatter: Slick.Formatters.PercentCompleteBar},
    {id: "start", name: "Start", field: "start", minWidth: 60},
    {id: "finish", name: "Finish", field: "finish", minWidth: 60},
    {id: "effort-driven", name: "Effort Driven", sortable: false, width: 80, minWidth: 20, maxWidth: 80, cssClass: "cell-effort-driven", field: "effortDriven", formatter: Slick.Formatters.Checkmark}
  ];
Run Code Online (Sandbox Code Playgroud)

jquery slickgrid

4
推荐指数
2
解决办法
1万
查看次数