Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6230595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:46:41+00:00 2026-05-24T09:46:41+00:00

I’ve look at the questions on here but can’t find an answer that specifically

  • 0

I’ve look at the questions on here but can’t find an answer that specifically matches what i’m trying to achieve…

Basically I have an SQL table that stores FAQ information. The table in question are below with the primary keys in bold.

Table: questions,
Fields: id_question, question, answer, status, etc……

Table: question_tags,
Fields: id_question, tag

Table: tags,
Fields: tags

The question_tags table is essentially a link between the question table and the tag table (i.e. many to many).

What I am looking to do is implement something like SQL MATCH AGAINST so when a user enters a question into the search box (PHP) the system looks up the questions table and searches the questions for the keywords in the search term. I can get this to work but what I want to be able to do is include the tags within the search. The reason for this is that I believe there are a number of different ways the same question can be using different words. The tags are supposed to compliment the question when searching. I understand that this is impossible using the MATCH AGAINST function within SQL so i’m kind of stuck.

Is there a way around this limitation?

Or instead of having each tag in a separate column of a separate table (linked with a third table) as above, should I simply create another field in the questions table for the entire tag string?

Or does anyone else have any other suggestions?

The solution will not be working with large datasets to begin with but it would be helpful if the solution was scalable.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T09:46:43+00:00Added an answer on May 24, 2026 at 9:46 am

    Tags may be a good candidate for de-normalization for this use case.

    One possibility would be something like

    SELECT * FROM 
    (
     SELECT Question, Answer, Status, MATCH(title,category) AGAINST ('keyword') as rank
     FROM questions 
     WHERE MATCH(Question,Answer) AGAINST ('Keyword')
     UNION 
     SELECT Question, Answer, Status, MATCH(Tag) AGAINST ('keyword')
     FROM questions Q 
     INNER JOIN question_tags QT   
         ON Q.id_question = QT.id_question
     INNER JOIN tags T
         ON QT.id_tag = T.id_tag 
     WHERE MATCH(Tag) AGAINST ('keyword')
    ) R
    ORDER BY rank
    

    Basically doing a FT search against question/answer and another on tags and unioning the resultset and then sorting by rank.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
Basically, what I'm trying to create is a page of div tags, each has
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to create an if statement in PHP that prevents a single post
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.