佳木斯湛栽影视文化发展公司

主頁 > 知識庫 > 如何實現(xiàn)全文檢索?

如何實現(xiàn)全文檢索?

熱門標(biāo)簽:服務(wù)器配置 銀行業(yè)務(wù) 智能手機 檢查注冊表項 網(wǎng)站文章發(fā)布 鐵路電話系統(tǒng) 美圖手機 呼叫中心市場需求

%@ LANGUAGE="VBscript" %>
  html>
  head>
  meta NAME="GENERATOR" Content="Microsoft FrontPage 3.0">
  meta HTTP-EQUIV="Content-Type" content="text/html; charset=gb_2312-80">
  title>星河影動之全文檢索/title>
  meta name="Microsoft Border" content="tl, default">

/head>
   body BGPROPERTIES="FIXED" BGCOLOR="#00FFFF">

%
  mousepointer=13
  Set Conn1 = Server.CreateObject("ADODB.Connection")
  conn1.open "DSN=intels"
  Set rcst1 = conn1.execute("select * from pages_catalogue")
  sch_str=request.form("text1")
  doubbytes=len(sch_str)\2
  sch_str=left(sch_str,doubbytes)

' 匹配字串的長度.預(yù)處理Request取得的數(shù)據(jù)(用戶輸入的有用信息), 通過計算有效信息長度來截取所需的字串.我們也可以在輸入字串后附加一標(biāo)志字符(如#chr(7))來處理.
  Response.Write "CENTER>檢索結(jié)果HR>Br>"
  Dim result
  result =false
  Response.Write "UL>"
  do while not rcst1.eof
  tit=rcst1.fields("file_title")
  fn=rcst1.fields("file_name")
  file_name= Server.MapPath ("/") "\song\chunfeng\" fn
  to_find=text_match(file_name,sch_str)

' 逐個打開記錄集中當(dāng)前記錄所指向的文件。用查找的字串對文件的全文本進行匹配比較.
  if to_find then
  url="chunfeng/" fn
  Response.Write "A HREF=" url ">
" tit
  end if
  rcst1.movenext
  result=result or to_find
  loop
  Response.Write "/UL>"

' 符合條件的文件標(biāo)題以超級鏈接形式輸出到客戶端.
  if not result then
  Response.Write "對不起,沒有找到!"
  end if
  mousepointer=0
  %>
  script RUNAT="Server" LANGUAGE="VBScript">
  function text_match(filename,search_string)
  dim retstring
  dim find_pos
  Dim fso, a
  dim done
  text_match=false
  Set fso = Server .CreateObject("Scripting.FileSystemObject
")

' 創(chuàng)建腳本的文件系統(tǒng),打開文本流以讀入.
  Set a = fso.OpenTextFile(filename, 1, FALSE)

done=a.AtEndOfStream or text_match
  Do While not done
  retstring = a.ReadLine
  find_pos=instr(retstring,search_string)
  if find_pos>0 then text_match=true
  done=a.AtEndOfStream or text_match
  Loop
  a.Close
  end function
  /script>
  /body>/html>

[1]

您可能感興趣的文章:
  • SqlServer 2005 簡單的全文檢索
  • SQL Server全文檢索查詢淺析
  • flex 實現(xiàn)全文檢索中的高亮顯示代碼
  • Oracle9i的全文檢索技術(shù)開發(fā)者網(wǎng)絡(luò)Oracle
  • 開發(fā)實例:JSP中實現(xiàn)全文檢索
  • 全文檢索技術(shù) sql server
  • SQLServer 全文檢索(full-text)語法

標(biāo)簽:新疆 紅河 長治 沈陽 河南 滄州 上海 樂山

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《如何實現(xiàn)全文檢索?》,本文關(guān)鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢

    • 400-1100-266
    织金县| 合肥市| 新河县| 北碚区| 正宁县| 尼勒克县| 平湖市| 延吉市| 朝阳县| 承德市| 犍为县| 当涂县| 琼中| 德兴市| 苏尼特右旗| 正镶白旗| 无极县| 孝昌县| 寻甸| 利辛县| 旬阳县| 承德市| 南京市| 当涂县| 建阳市| 兴文县| 楚雄市| 阳春市| 永昌县| 岗巴县| 贵德县| 乌鲁木齐县| 青州市| 五大连池市| 沁阳市| 丽水市| 聂拉木县| 张家港市| 咸丰县| 靖西县| 石河子市|