从Google自定义搜索中排除FTP结果

时间:2014-11-21 06:41:37

标签: google-custom-search

我确实得到了我的代码来实现下面的谷歌自定义搜索:

<script> 
  (function() { 
    var cx = '007573243353096205708:4ydbnopnt9s'; 
    var gcse = document.createElement('script'); 
    gcse.type = 'text/javascript'; 
    gcse.async = true; 
    gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + 
        '//www.google.com/cse/cse.js?cx=' + cx; 
    var s = document.getElementsByTagName('script')[0]; 
    s.parentNode.insertBefore(gcse, s); 
  })(); 
</script> 
<gcse:search></gcse:search> 

但是这段代码和我的公共网址显示了FTP结果。 当我尝试排除像ftp://www.mysite.com/ *这样的ftp结果时 它排除了所有结果。

我应该怎么做,以便我的搜索不包括FTP结果。

我看到了这个链接,但无法理解建议代码的位置 https://productforums.google.com/forum/#!searchin/customsearch/ftp%7Csort:relevance/customsearch/CitHAOTAgS4/W79di_lOuS8J

感谢任何帮助。

0 个答案:

没有答案