MySQL自带有全文搜索功能:
http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html
创建一个全文搜索表:
CREATE TABLE articles (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
title VARCHAR(200),
body TEXT,
FULLTEXT (title, body)
) ENGINE=MyISAM;
插入几条数据:
INSERT INTO articles (title,body) VALUES
('MySQL Tutorial','DBMS stands for DataBase ...'),
('How To Use MySQL Well','After you went through a ...'),
('Optimizing MySQL','In this tutorial we will show ...'),
('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
('MySQL vs. YourSQL','In the following database comparison ...'),
('MySQL Security','When configured properly, MySQL ...');
使用全文搜索查询语句:
SELECT * FROM articles WHERE MATCH (title, body) AGAINST ('database');
MySQL Full-Text Search Functions还支持Boolean模式查询和Query Expansion
MySQL Full-Text Search有一些限制:
1,仅支持MyISAM tables
2,支持大部分多字节字符集,对Unicode只支持utf8不支持ucs2
3,对中文和日语支持不好,因为没有word delimiters
4,若支持在一个单独表中使用多字符集,则所有 FULLTEXT索引中的列 必须使用同样的字符集和库。
5,MATCH()列列表必须同该表中一些 FULLTEXT索引定义中的列列表完全符合,除非MATCH()在IN BOOLEAN MODE
6,对AGAINST() 的参数必须是一个常数字符串
MySQL Full-Text Search的配置
全文变量t_min_word_len、 ft_max_word_len指定搜索字的长度
ft_stopword_file可以自定义保留字
分享到:
相关推荐
performance properties of MySQL build in full text search functionality using real medium size text collection - Wikipedia Articles dump, when we compare it to other opensource full text search ...
Tables can be encrypted · Full-text indexing for very fast keyword search Compared to the database client components for InterBase and MySQL included in Kylix, TurboDB · is much easier to install ...
与Elasticsearch的非常相似完全用C ++编写:启动速度快,不需要太多RAM,低级优化可提供良好的性能实时插入:插入后,可以立即读取文档让学习更轻松内置复制和负载平衡可以直接从MySQL / PostgreSQL / ODBC / xml /...
概观RadonDB是一个开源的,云原生MySQL数据库,具有无限的可扩展性和性能。什么是RadonDB? RadonDB是基于MySQL的云原生数据库,并在完全分布式的集群中进行设计,可实现无限的可扩展性(横向扩展),容量和性能。 ...
text data for full-text search. The chapter also presents performance characteristics of the proposed indexing technique in three systems, namely MySQL, FastBit, and MonetDB. Chapter 10 proposes the ...
Rails自动完成与ElasticSearch和SearchKick意图我打算建立此仓库的目的是分享我对该主题的简要知识:全文搜索或...ElasticSearch x PostgreSQL x MySQL 一个简单的“搜索”可以为您带来许多在更常见的DBMS(例如MySQL或
完全基于建模设计和实现,可以很方便的植入其他程序中,例如:MySQL,PHP,并提供无需修改即可在各种平台下编译使用,加载完20万的词条,内存占用稳定为14.5M。 Friso核心功能: 中文分词:mmseg算法+ Friso独创的...
The following is a summary of its search order: ; 1. SAPI module specific location. ; 2. The PHPRC environment variable. (As of PHP 5.2.0) ; 3. A number of predefined registry keys on Windows (As of ...
...----------------------------------...64. The Full Text Search 65. Specialities of this Edition 66. Integrating the PHP Manual 67. Skin development 68. CHM Edition Credits 前进 前言
数据库和配置MySQL 飞路(用于数据迁移) GradleTomcat吉特Google Book API 后端技术JavaSpring MVC,Spring AOP,Spring Security Hibernate ORM,Hibernate Validator,Hibenrate Search(Lucene) 翻新,JSON ...
Incremental search is an inline, progressive search that allows you to find matched text as you type, much like Firefox's search feature Regular expressions Regular Expressions are essentially ...
Preface 3 Chapter 6, Routing Magic: Almost every web-based application will eventually ...datasources to deal with non-relational data, and teaches us how to create a full-featured twitter datasource.
=== Simple Tags === ... * Restore full manage page * Fix duplicate tags for click tags and autocompletion * Lot's of optimization... * Update translations * Add spanish translation * Version ...
序文 I. 入门指引 1. 简介 2. 简明教程 3. 安装 4. 运行时配置 ...59. The Full Text Search 60. Specialities of this Edition 61. Integrating the PHP Manual 62. Skin development 63. CHM Edition Credits
I. 入门指引 1. 简介 2. 简明教程 II....3. 安装前需要考虑的事项 ...64. The Full Text Search 65. Specialities of this Edition 66. Integrating the PHP Manual 67. Skin development 68. CHM Edition Credits
... Mehdi Achour Friedhelm Betz Antony Dovgal ...75. The Full Text Search 76. Specialities of this Edition 77. Integrating the PHP Manual 78. Skin development 79. CHM Edition Credits
PHP,即“PHP: Hypertext Preprocessor”,是一种被广泛使用的开放源...75. The Full Text Search 76. Specialities of this Edition 77. Integrating the PHP Manual 78. Skin development 79. CHM Edition Credits
<END><br>31 , datsearch.zip Application which searches an Access database for a specified search term entered by the user.<END><br>32 , DBTextGrid.zip This program is the modification of my ...
$full1 = "$first $second"; # 产生 Hello World $full2 = '$first $second';# 产生 $first $second 可以将字符和数字利用运算符号连接起来。字符被转化成数字,利用其最初位置。在PHP手册中有详细的例子。 数组与...