Match Against Mysql statement.

Doing a search of a "forum" type setup..
Two tables
forum_posts, forum_replies  will be searching feilds ( title , content ) in both tables.

i need to search both tables get a score back combine the scores then select from the forum_posts the in the order of the scores with the matching.

forum_posts.post_id = forum_replies.parent_id

i do not need anything from the forum_replies as far as data

this HAS to be 1 mysql query.


the below does not work correctly but its something ive been trying to work on.
 SELECT posts. * ,
MATCH (
posts.subject, posts.content
)
AGAINST (
'test* search*'
IN BOOLEAN
MODE
) AS score_posts
FROM `forum_posts` AS posts, replies. * ,
MATCH (
replies.subject, replies.content
)
AGAINST (
'test* search*'
IN BOOLEAN
MODE
) AS score_replies
FROM `forum_replies` AS replies
WHERE MATCH (
replies.subject, replies.content
)
AGAINST (
'test* search*'
IN BOOLEAN
MODE
)
ORDER BY total_score DESC
LIMIT 0 , 30
remlabAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Brian BushSolutions ArchitectCommented:
Try something like this:

SELECT
  posts.id,
  replies.parent_id,
  MATCH(
    posts.subject,
    posts.content
  ) AGAINST(
    'test* search*'
    IN BOOLEAN MODE
  ) +
  MATCH(
    replies.subject,
    replies.content
  ) AGAINST(
    'test* search*'
    IN BOOLEAN MODE
  ) AS score
FROM
  `forum_posts`   AS posts,
  `forum_replies` AS replies
WHERE
  posts.id = replies.parent_id
ORDER BY
  score DESC
LIMIT 0, 30

I think that's going to give you what you want.
--brian

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
remlabAuthor Commented:
Has not been answered yet. was waiting for more user comments.
Brian BushSolutions ArchitectCommented:
Do you think you could respond to my post?
Did you try the query? Did it not work? What results did it give
versus what results were you expecting?

You have to give us something to work with here.
--brian
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.