Atitit.软件按钮与仪表盘(13)--全文索引操作--db数据库子系统mss
Atitit.软件按钮与仪表盘(13)--全文索引操作--db数据库子系统mssql2008 全文索引操作 4.全文索引和like语句比较 1 5.倒排索引 inverted index 1 2.SQL Server 2008全文检索 2 3.Lucene全文检索 3 一般情况,使用SQL Server中的全文索引,经过大体4个步骤: 4
Atitit.软件按钮与仪表盘(13)--全文索引操作--db数据库子系统mssql2008
全文索引操作
4.全文索引和like语句比较 1
5.倒排索引 inverted index 1
2.SQL Server 2008全文检索 2
3.Lucene全文检索 3
一般情况,使用SQL Server中的全文索引,经过大体4个步骤: 4
Mssql2008的全文索引操作(attilax验证) 5
查看全文index使用大小 5
查看表行数与体积大小 6
参考 6
4.全文索引和like语句比较
当然是全文索引的执行效率高.
一般全文索引使用的是倒排索引,能够支持多关键字的索引,而LIKE只有前缀匹配时才能使用索引,否则就是全表扫描,效率当然很低
但全文索引存在填充问题,需要在增加内容后进行增量填充,否则检索不到新增的内容的。Sql Server 2008里可采用基于更改跟踪的填充, 速度飞快, 几乎可以认为就是实时增量填充了.
作者::老哇的爪子Attilax艾龙,EMAIL:1466519819@qq.com
转载请注明来源: http://blog.csdn.net/attilax
5.倒排索引 inverted index
为什么Sql server全文检索和Lucune全文检索速度快呢, 因为它和大多数搜索引擎一样, 都使用了倒排索引 inverted index
2.SQL Server 2008全文检索
为了提高效率, 换用sql server的全文检索, 怎么建全文检索就此略去, 不提, 只看查询方法.
例如: select * from table where contains(ProductDesc, '*cad*')
它查询的效率很高, 支持中文分词(但好不好就另说了), 但缺点竟然是在英文查询上, 如果想模糊查询带cad三个字母的数据, 它只能搜索出以cad为完整单词的数据, 例如: 它能查出abc cad , cad def, 或者cad, 它不能查出autocad这种字母连在一起的数据, 也就是说, sql server的全文检索的英文分词是空格, 要想查连在一起的英文词, 它办不到, 得另寻第三方的全文索引了, ms如果在这里开个可扩展的口子多好, 可惜了.
索引的更新填充问题: 创建好全文检索就自动来一次完全填充, 如果在跟踪更改处选择自动, 全文检索就会采用基于更改跟踪的填充, 原表数据一旦有改动, 就会从后台悄悄地传播过来, 自动的更新全文索引. 具体可参考http://msdn.microsoft.com/zh-cn/library/ms142575.aspx
在更新全文索引之前这段时间, 搜不到新录入但未收入全文索引的数据, 但like可查到. 虽然不是实时的, 但是经过测试, 我发现这个更新速度非常之快, 几乎一改原表, 全文索引就更新了, 所以我觉得可以认为实时的, 估计sqlserver内部应该是用观察者模式实现这个功能的.
另外, contains包含的列都必须来自同一个表, 不能跨表, 例如where contains(a.ProductDesc, b.ProductName, '*cad*'), 这样是不行的.
3.Lucene全文检索
SQL server全文检索不灵了, 只能找第三方的方案了, 首当其冲的就是Lucene了, 但在.net下, Lucene却很不顺当.
NLucene是将 Lucene 从 Java 移植到 .NET 的一个 SourceForge 项目,它从 Lucene 1.2 版本转化而来, 但2002年就停止更新了.
因为 NLucene 项目到2002年就没有再推出新的版本,可Lucene 却一直在发展,于是有人把Lucene 1.3版移植到.NET就成了Lucene .NET,但是Lucene .Net发展到2.0版的时候变成了商业化的产品,脱离了开源项目, 听说现在进了孵化器已停止开发了, 但上官网http://incubator.apache.org/lucene.net/download.html上看, 还仍然在更新中似乎没有停止, 最新开源的版本是2.9.2, 发布日期是2011年5月6日, 他们还在准备2.9.4版.
受到Lucene.Net脱离开源项目的影响,有人为了继续发展开源.Net搜索引擎,于是在Lucene.Net的原有基础上继续发展该项目,但是名字改成了DotLucene以区别于Lucene.Net。但现在打开官网一看, 得, 又停止了. 看来, 只能用Lucene.Net2.0这最后一个开源版本了.
索引的更新填充问题: 也是要隔一段时间更新一次索引, 也是不可实时更新的, 需要定期更新填充才可以, 如果需要频繁更新推荐删除旧的然后重建索引.
一般情况,使用SQL Server中的全文索引,经过大体4个步骤:
1). 安装full text search全文索引服务;
2). 为数据表建立full text catalog全文索引目录;
3). 进行full text catalog的population操作(使全文索引与数据表内容同步);
4). 使用全文索引进行查询。
Mssql2008的全文索引操作(attilax验证)
1.启动SQL Full-text Filter Daemon Launcher (MSSQLSERVER) 服务
2.建设:::索引表格>>ritkey>>全文index>>创建fulltxt 或者
Db>存储>>全文目录>新建全文目录
3..增添计划>>cpu 空闲的.....
4. 4. 使用索引功能:
select * from mybbs_Table where Contains(col2,'"windows"');
速度还凑火..
查看全文index使用大小
增添状态:::正在处理通知 ..表明目前等候插入....平常状态..
目录大小:::5g
查看表行数与体积大小
表格属性>>存储...>>>35G
参考
Lucene.Net, SQL Server 2008全文检索, Like模糊查询的一点心得 - BobLiu - 博客园.html
使用SQL Server中的全文索引_知识库_博客园.html

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

CrystalDiskMark is a small HDD benchmark tool for hard drives that quickly measures sequential and random read/write speeds. Next, let the editor introduce CrystalDiskMark to you and how to use crystaldiskmark~ 1. Introduction to CrystalDiskMark CrystalDiskMark is a widely used disk performance testing tool used to evaluate the read and write speed and performance of mechanical hard drives and solid-state drives (SSD). Random I/O performance. It is a free Windows application and provides a user-friendly interface and various test modes to evaluate different aspects of hard drive performance and is widely used in hardware reviews

CrystalDiskInfo is a software used to check computer hardware devices. In this software, we can check our own computer hardware, such as reading speed, transmission mode, interface, etc.! So in addition to these functions, how to use CrystalDiskInfo and what exactly is CrystalDiskInfo? Let me sort it out for you! 1. The Origin of CrystalDiskInfo As one of the three major components of a computer host, a solid-state drive is the storage medium of a computer and is responsible for computer data storage. A good solid-state drive can speed up file reading and affect consumer experience. When consumers receive new devices, they can use third-party software or other SSDs to

There could be several reasons why your Windows laptop won't boot. Memory failure, dead battery, faulty power button, or hardware issues are all common causes. Here are some solutions to help you resolve this issue. Laptop won't turn on after pressing the power button If your Windows laptop still won't turn on after pressing the power button, here are some steps you can take to resolve the issue: Is your laptop fully charged? Perform a hard reset to clean your laptop Reseat the memory Transparent CMOS type battery Take your laptop for repair. 1] Is your laptop fully charged? The first thing to do is to check if your laptop is fully charged. Laptop won't start if battery is drained

After the release of the iPhone 15 series, there have been constant revelations about the appearance and configuration of Apple’s new iPhone 16. What does iPhone 16 look like? Is there any improvement in iPhone 16? Recently, an overseas blogger showed off the design of the iPhone 16 series. The overall design is basically the same as the iPhone 15 series. As you can see from the picture, the entire iPhone 16 series is equipped with a new "shoot" button as standard, allowing users to take photos more conveniently. In addition, other design details are still unknown. The message shows that this new button will be used to shoot videos and is located below the power button. Previous news has mentioned that it may be a capacitive solid-state button, but recent reports indicate that it should still be a

When we use the Edge browser, sometimes incompatible software attempts to be loaded together, so what is going on? Let this site carefully introduce to users how to solve the problem of trying to load incompatible software with Edge. How to solve an incompatible software trying to load with Edge Solution 1: Search IE in the start menu and access it directly with IE. Solution 2: Note: Modifying the registry may cause system failure, so operate with caution. Modify registry parameters. 1. Enter regedit during operation. 2. Find the path\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Micros

PhotoshopCS is the abbreviation of Photoshop Creative Suite. It is a software produced by Adobe and is widely used in graphic design and image processing. As a novice learning PS, let me explain to you today what software photoshopcs5 is and how to use photoshopcs5. 1. What software is photoshop cs5? Adobe Photoshop CS5 Extended is ideal for professionals in film, video and multimedia fields, graphic and web designers who use 3D and animation, and professionals in engineering and scientific fields. Render a 3D image and merge it into a 2D composite image. Edit videos easily

LinuxDeploy operating steps and precautions LinuxDeploy is a powerful tool that can help users quickly deploy various Linux distributions on Android devices, allowing users to experience a complete Linux system on their mobile devices. This article will introduce the operating steps and precautions of LinuxDeploy in detail, and provide specific code examples to help readers better use this tool. Operation steps: Install LinuxDeploy: First, install

With the popularity of smartphones, the screenshot function has become one of the essential skills for daily use of mobile phones. As one of Huawei's flagship mobile phones, Huawei Mate60Pro's screenshot function has naturally attracted much attention from users. Today, we will share the screenshot operation steps of Huawei Mate60Pro mobile phone, so that everyone can take screenshots more conveniently. First of all, Huawei Mate60Pro mobile phone provides a variety of screenshot methods, and you can choose the method that suits you according to your personal habits. The following is a detailed introduction to several commonly used interceptions:
