Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/string/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
html内容中的全文搜索_Html_String_Sqlite_Full Text Search - Fatal编程技术网

html内容中的全文搜索

html内容中的全文搜索,html,string,sqlite,full-text-search,Html,String,Sqlite,Full Text Search,我需要有html内容的全文搜索。我有一个解决方案,但在我决定之前,我想检查是否还有其他解决方案 我将描述一个非常简单的例子。我有一个包含一些数据的表格: CREATE VIRTUAL TABLE Post USING fts3(Title, Content); INSERT INTO post VALUES("Title 1", "Some content"); INSERT INTO post VALUES("Title 2", "<b>S</b>ome <b&g

我需要有html内容的全文搜索。我有一个解决方案,但在我决定之前,我想检查是否还有其他解决方案

我将描述一个非常简单的例子。我有一个包含一些数据的表格:

CREATE VIRTUAL TABLE Post USING fts3(Title, Content);
INSERT INTO post VALUES("Title 1", "Some content");
INSERT INTO post VALUES("Title 2", "<b>S</b>ome <b>C</b>ontent");
它将找到第一排

我的解决办法是做两张桌子。对于html内容,第一个表是正常的(不是全文搜索),第二个表是打开全文搜索的纯文本内容。第二个表将包含来自第一个表的内容,但没有html标记

在sqlite中执行此操作对我来说很重要

FTS模块用于检测文本中的单词

没有忽略HTML标记的内置标记器;您必须编写一个自定义标记器。 最好使用包含纯文本数据的表

SELECT * FROM post WHERE Content MATCH 'Some';