2

I have a following table called tags like id|tag_title|post_id and a table posts with id|title

i am able to search using fulltext functionality but that is only restricted to searching the title in the posts table. What i want is to search both in tags and posts table and get best results . How can i accomplish it...!!!

My query:

Select title from posts where Match(title) Against('$search' in boolean mode)
1
  • I updated @ragingBull Commented May 5, 2014 at 10:46

1 Answer 1

1

You can try:

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)

If you want something more advanced, check out Apache Solr or Apache Lucence

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.