全文搜索 [英] Full Text Search

查看:76
本文介绍了全文搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好Everone,

我正在使用全文搜索作为我们的搜索算法.

说明:说有一个名为Table1的表,其中包含以下列

请注意:Table1的列以真实的方式给出,以使问题具有更好的可见性.

ID(第1列)
1
2
3
4

名称(第2列)

聚碳酸酯
维修店
梅赛德斯·奔驰


说明(第3列)
丸木铃木汽车
用于合成聚乙烯的化学物质
汽车修理厂


我在Table1的名称"和描述"列上给出了全文索引.
在网页上,我输入要搜索的关键字,该关键字应该在名称"或描述"中或在两者中都可以.我为此使用FREETEXTTABLE谓词.

例如,说我搜索汽车",它将从ID 1到4列出所有上述结果,因为它将搜索所有行中都存在的关键字汽车".

但是,聚碳酸酯"(Id = 2)中的汽车"与我的搜索无关,因此,我只需要3条ID = 1,3,4的记录.但是我无法使用当前的实现找到任何解决方案来避免这种情况.

你能帮我这个忙吗?这是非常紧急的要求.

提前谢谢.

祝你有美好的一天.

Hello Everone,

I am using Full Text Search for our Search Algorithm.

Description: Say there is a table called as Table1 which contains following columns

Pls. Note: Columns of Table1 are given in veritical fashion to have a better visiblity in the question.

Id (Column 1)
1
2
3
4

Name (Column 2)
Car
Polycarbonate
Repair shop
Mercedes Benz


Description (Column3)
Maruti Suzuki Car
Chemical used to compose polythene
Motor car repair shop
Car

I have given full text index on Name and Description columns of Table1
From webpage I enter a keyword to search which should either be in Name or Description or both. I am using FREETEXTTABLE predicate for this.

For example say I searched for "Car" it will list down all the above results from Id 1 to 4 because it will search for the keyword "car" which is there in all the rows.

Howwever, "car" in "Polycarbonate" (Id=2) is not relevant to my search, hence I want only 3 records that is Id = 1,3,4. But I am unable to find any solution to avoid such situation using my current implementation.

Can you please help me out on this. This is very urgent requirement.

Thanks in advance.

Have a nice day.

推荐答案

尝试 [^ ]


这篇关于全文搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆