表名是'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?
更多推荐
发布评论