zoukankan      html  css  js  c++  java
  • 实例演示在SQL中启用全文检索

    < DOCTYPE html PUBLIC -WCDTD XHTML StrictEN httpwwwworgTRxhtmlDTDxhtml-strictdtd>

    如何在SQL中启用全文检索功能?本文将通过实例向你剖折这个问题。这是一个全文索引的一个例子,首先在查询分析器中使用:


      use pubs
      go
      --打开数据库全文索引的支持


     execute sp_fulltext_database 'enable'
     go
      --建立全文目录ft_titles


      execute sp_fulltext_catalog 'ft_titles', 'create'
      go
      --为titles表建立全文索引数据元,UPKCL_titleidind是主键所建立的唯一索引,可由sp_help titles得知


      execute sp_fulltext_table 'titles','create', 'ft_titles', 'UPKCL_titleidind'
      go
      --设置全文索引列名


      exec sp_fulltext_column 'titles', 'title', 'add'
      go
      exec sp_fulltext_column 'titles', 'notes', 'add'
      go
      --建立全文索引


      exec sp_fulltext_table 'titles', 'activate'
      go
      --填充全文索引目录


      exec sp_fulltext_catalog 'ft_titles', 'start_full'
      go
      --使用contains和freetext


      select title, notes from titles
      where contains(title, '"computer Cooking"')
      go
      select title, notes from titles
      where freetext(title, 'computer Cooking')
      go
      select title, notes from titles
      where freetext(title, '"computer Cooking"')
      go
      select title, notes from titles
      where contains(title, 'computer')
      go
      select title, notes from titles
      where freetext (*, 'computer')
      go
  • 相关阅读:
    CI持续集成系统环境--Gitlab+Gerrit+Jenkins完整对接
    解惑|你是否为容器监控操碎了心?
    4 使用smartcar进行仿真
    1 简单的ROS机器人仿真
    1 rbx1 Kinetic 安装和测试
    2020.4.13 Resources
    2. dwa_local_planner_params.yaml 参数意义
    robotics
    PCL 点云处理
    C++异常处理解析
  • 原文地址:https://www.cnblogs.com/netcorner/p/2911981.html
Copyright © 2011-2022 走看看