主题:  谁有站内搜索的代码》?

懒虫

职务:普通成员
等级:5
金币:10.0
发贴:3273
注册:2000/11/11 15:06:35
#12001/6/7 21:57:05
根据关键字搜索页面的那种,很急谢谢了

编辑历史:[这消息被懒虫编辑过(编辑时间2001-06-07 22:29:25)]


IBM里的拖鞋

职务:普通成员
等级:4
金币:10.0
发贴:2033
注册:2004/10/23 0:09:05
#22001/6/8 4:33:58
我曾在电脑报中看到过关于你关心的问题,具体是那一期我忘了,但有一点可以肯定.

那就是是在去年的电脑报中看到的.


QQ:16408396

QQlan

职务:版主
等级:1
金币:1.0
发贴:158
注册:2000/9/19 10:35:21
#32001/6/8 22:18:06
这是一个让人伤心的主题.
如果使用 js 来做站内搜索, 实在是一种痛苦的事.
首先, 可以用 js实现站内搜索.
但是实现的方法千篇一律的无奈.

我们在写js的时候, 必须在已经完成的完全静态的站(我的意思是没有后台程序的)上,
制作一个js页面, 例出你的站的所有搜索关键字, 有些js是copy所有页的文字内容.
然后在js文件内部进行字符串搜索.

我整理一下贴出来.



懒虫

职务:普通成员
等级:5
金币:10.0
发贴:3273
注册:2000/11/11 15:06:35
#42001/6/8 22:18:28
不会吧?

我没有这本书,很难找

朋友们,那位有原代码啊



QQlan

职务:版主
等级:1
金币:1.0
发贴:158
注册:2000/9/19 10:35:21
#52001/6/8 22:25:57
here we go ....

www.hairme.com/other/engine.zip
这个包里包含页面样版.
手工的收集网站各个页的关键字.


www.hairme.com/other/searchmp21.zip
包含一个.exe文件帮助你整理站的内容.
原理是copy每个页的所有文字,分类,搜索.


------------------------------------------------------------------------
建议如果只是个人使用,
试用frantpage的search .

如果打算使用后台程序支持,
php, asp, perl 都能写出出色的 search

总之使用 js做search是这个世界上最为痛苦无奈的选择,
建议放弃.



QQlan

职务:版主
等级:1
金币:1.0
发贴:158
注册:2000/9/19 10:35:21
#62001/6/8 22:31:31
如果还是有人执迷不悔的热爱 js search ...
下面是对 engine.zip 文件原代码的一些解释

需要至少3个文件.
index.htm (search box)
engine.js (搜索成功的关键)
engine.htm (confirm 页)

-------------------------------------------------------------------index.htm























--------------------------------------------------------------------engine.js

var item=new Array();
// "Page Name","path","Page Title","Many,Key,Words","Descritptive Comments"
item[item.length]=new Array("index.html","","DemoSite","index,main,start,home,front","Demonstration search engine data about an imagined but probable internet site.");
item[item.length]=new Array("about.htm","","About Me","about,author,contact,email,who","Contact details and general information about the creator of the site and what the site is about.");
item[item.length]=new Array("links.htm","","Links page","links,more,where,similar,friends","Links to my favourite sites which I find interesting. Other friends sites which have similar interests to my own.");
item[item.length]=new Array("main.htm","main/","Main Page","content,main,focus","The main part of my site which contains what you have come to see. Lots of stuff like that and more great things. All in a sub directory.");
item[item.length]=new Array("logo.jpg","main/images/","Link Logo","link,image,logo,graphic","The logo.jpg is just a small image which you can place on your site as a link to me. It's in a second level subdirectory.");




--------------------------------------------------------engine.html


Search Results













编辑历史:[这消息被QQLan编辑过(编辑时间2001-06-08 22:32:52)]


懒虫

职务:普通成员
等级:5
金币:10.0
发贴:3273
注册:2000/11/11 15:06:35
#72001/6/8 23:35:50
是站内搜索吗?

我想达到一个效果,就是输入几个

j就是象这样的

www.qzone.com/home/w/wa/wangwolue/wwl/photoshop/myimage/search.html



QQlan

职务:版主
等级:1
金币:1.0
发贴:158
注册:2000/9/19 10:35:21
#82001/6/9 0:12:36
如果我的理解不错的话,

那个查询使用 js 结合 jsp (java server page)

我仍然坚持,
仅仅用 js 做不了好网站的 search. ( i mean, 一页一页的search)

那个查询里, 只有一个数据文件 (就是下面这个 items.txt )
www.qzone.com/home/w/wa/wangwolue/wwl/photoshop/myimage/items.txt
然后仅仅对那一个文件进行string search ..


编辑历史:[这消息被QQLan编辑过(编辑时间2001-06-09 00:14:13)]


懒虫

职务:普通成员
等级:5
金币:10.0
发贴:3273
注册:2000/11/11 15:06:35
#92001/6/9 0:52:02
能告诉我详细的制作过程吗/?

麻烦你了


每页显示15条 1/1 << <1 >>