How to implement a Keyword Search in MySQL?

后端 未结 7 1054
温柔的废话
温柔的废话 2020-11-29 20:25

I am new to SQL programming.

I have a table job where the fields are id, position, category, location, sala

相关标签:
7条回答
  • 2020-11-29 21:19

    Ideally, have a keyword table containing the fields:

    Keyword
    Id
    Count (possibly)
    

    with an index on Keyword. Create an insert/update/delete trigger on the other table so that, when a row is changed, every keyword is extracted and put into (or replaced in) this table.

    You'll also need a table of words to not count as keywords (if, and, so, but, ...).

    In this way, you'll get the best speed for queries wanting to look for the keywords and you can implement (relatively easily) more complex queries such as "contains Java and RCA1802".

    "LIKE" queries will work but they won't scale as well.

    0 讨论(0)
提交回复
热议问题