简体   繁体   English

使用Google搜索在我的网站上实施搜索的最佳方法是什么?

[英]What is the best way to implement search on my site using google search?

I'm developing a simple site for local student contest. 我正在为当地学生比赛开发一个简单的网站。 I want to implement some basic search functionality (just a textbox with submitButton or submitLink). 我想实现一些基本的搜索功能 (只是一个带有SubmitButton或SubmitLink的文本框)。 The site contains several pages with static informational content there, and one google-forms iframe(register for the event). 该网站包含多个页面,其中包含静态信息内容,以及一个Google表单iframe(注册活动)。

Is it a good idea to implement my search with javascript which redirects user to something like http://www.google.ru/search?q=BLAH+BLAH+site:mysite.com ? 用javascript将用户重定向到http://www.google.ru/search?q=BLAH+BLAH+site:mysite.com之类的搜索来实现我的搜索是一个好主意吗?

The less code, the better. 代码越少越好。 Server-side code would not be great, but still ok. 服务器端代码不是很好,但是还可以。

Thank you. 谢谢。

Have a look at the Google Custom Search Engine: http://www.google.com/cse/ 看看Google自定义搜索引擎: http : //www.google.com/cse/

It's extremely simple to set up, basically it's just a matter of copy pasting and as far as I understand, it will give you exactly what you want. 设置非常简单,基本上只是复制粘贴的问题,据我所知,它可以为您提供所需的一切。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM