簡體   English   中英

制作一個簡單的搜索引擎php mysql

[英]Making a simple search engine php mysql

我有一個名為id|tag_title|post_id類的tags的下表,以及具有id|title的表posts

我能夠使用fulltext功能進行搜索,但僅限於在posts表中搜索title 我想要的是在tagsposts表中搜索並獲得最佳結果。 我該怎么做... !!!

我的查詢:

Select title from posts where Match(title) Against('$search' in boolean mode)

你可以試試:

SELECT title FROM posts WHERE Match(title) Against('$search' IN boolean mode)
UNION
SELECT title FROM posts INNER JOIN tags ON posts.id = tags.post_id WHERE Match(tag_title) Against('$search' IN boolean mode)

如果您需要更高級的功能,請查看Apache Solr或Apache Lucence。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM