全文搜索

编程入门 行业动态 更新时间:2024-10-26 00:25:54
本文介绍了全文搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

你好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.

推荐答案

尝试此 [^ ]

更多推荐

全文搜索

本文发布于:2023-10-18 23:48:09,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1505779.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:全文

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!