搜索功能具有相似性功能(Search function with similarity function)

编程入门 行业动态 更新时间:2024-10-23 11:20:14
搜索功能具有相似性功能(Search function with similarity function)

表名是'pages'..

我需要创建一个搜索功能,在那里我可以提交字段$ _POST ['search'] ['s_value']并检查它是否像字段'emne'或'tekst'一样。

但在这个问题上我也想,我的查询按照匹配的百分比排序..所以,如果我正在寻找“汽车租赁”,我有一个页面说“过去几年的汽车租赁更容易”这是100%。

如果有可能的话,我还希望搜索到文本的第一个匹配“预告片”,在div中使用class ='search_highligthed_text'突出显示它。

是否有可能创造???

The table name is 'pages'..

I need to make a search function, where I can submit the field $_POST['search']['s_value'] and check if it is LIKE the fields 'emne' or 'tekst'..

But in that matter I would also like, that my query is ordering by the percentage of matching.. So if I'm searching for "car rental" and I have a page which say "car rental has been easier over the past years" it is 100%.

If it is possible, I would also like the search to make a 'teaser' with the first match of the text, where it is highlighted in a div with the class='search_highligthed_text' ..

Is that in any way possible to create???

最满意答案

对不起,我无法解决Similar_text(); 你为什么不把数据放在数组中而不是排序呢?

Sorry, i cannot undertand the problem with similar_text(); why don't you just put data in an array an than sort them?

更多推荐

本文发布于:2023-07-22 12:17:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1219946.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:性功能   搜索功能   Search   function   similarity

发布评论

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

>www.elefans.com

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