国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

全文本檢索的應用(2)

2024-07-21 02:09:22
字體:
來源:轉載
供稿:網友

contains 語法
我們通常在 where 子句中使用 contains ,就象這樣:select * from table_name where contains(fulltext_column,'search contents')。

我們通過例子來學習,假設有表 students,其中的 address 是全文本檢索的列。
1. 查詢住址在北京的學生
select student_id,student_name
from students
where contains( address, 'beijing' )
remark: beijing是一個單詞,要用單引號括起來。

2. 查詢住址在河北省的學生
select student_id,student_name
from students
where contains( address, '"heibei province"' )
remark: hebei province是一個詞組,在單引號里還要用雙引號括起來。

3. 查詢住址在河北省或北京的學生
select student_id,student_name
from students
where contains( address, '"heibei province" or beijing' )
remark: 可以指定邏輯操作符(包括 and ,and not,or )。

4. 查詢有 '南京路' 字樣的地址
select student_id,student_name
from students
where contains( address, 'nanjing near road' )
remark: 上面的查詢將返回包含 'nanjing road','nanjing east road','nanjing west road' 等字樣的地址。
          a near b,就表示條件: a 靠近 b。

5. 查詢以 '湖' 開頭的地址
select student_id,student_name
from students
where contains( address, '"hu*"' )
remark: 上面的查詢將返回包含 'hubei','hunan' 等字樣的地址。
          記住是 *,不是 %。

6. 類似加權的查詢
select student_id,student_name
from students
where contains( address, 'isabout (city weight (.8), county wright (.4))' )
remark: isabout 是這種查詢的關鍵字,weight 指定了一個介于 0~1之間的數,類似系數(我的理解)。表示不同條件有不同的側重。

7. 單詞的多態查詢
select student_id,student_name
from students
where contains( address, 'formsof (inflectional,street)' )
remark: 查詢將返回包含 'street','streets'等字樣的地址。
         對于動詞將返回它的不同的時態,如:dry,將返回 dry,dried,drying 等等。

以上例子都使用英文,不使用中文是因為有的查詢方式中文不支持,而且我的計算機是英文系統

付:對《全文檢索1得質疑》:

5. 更新全文本索引的過程比常規索引要耗時,而且也不象常規索引那樣可以由數據庫系統立即更新。
可以立即更新的
9. 如果在查詢中包含 noise words ,就會引發錯誤,在應用程序中應去除這些 noise words。
不對,查詢時會自己過濾掉noise word,只有查詢的內容全是noise words時才會出現錯誤

全文本檢索的應用(1) 

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 乌海市| 桦南县| 博野县| 东明县| 井研县| 襄垣县| 东兴市| 武乡县| 河间市| 太白县| 许昌市| 五寨县| 津市市| 渭南市| 贵港市| 昆山市| 青州市| 开化县| 东台市| 响水县| 普定县| 安乡县| 清水县| 土默特左旗| 赤峰市| 沐川县| 金塔县| 白水县| 靖边县| 图木舒克市| 沅陵县| 浦北县| 泉州市| 浦江县| 漯河市| 汽车| 灯塔市| 彭州市| 黑龙江省| 谷城县| 苍溪县|