Searchable database design

  • I want to build a database that would allow employees to search for a report based on keyword(s) that they specify.

    The database would contain the name of the report and any keywords associated with that report. For example:

    Report 1 name, address, email

    Report 2 name, title, department

    What is the best way to do this? What type of data should the keywords column be (text, varchar) or does it matter? And how would I go about allowing employees to search for a particular report based on keywords? Say an employee searches for "name, email", how would I allow them to specify multiple keywords and allow for the commas between those words?

    Any help would be appreciated.

  • You probably want to use Full-Text indexing for searches like this. It would be good for you to look up the topic in books online and get familiar with it. It will help you solve a lot of the issues you will run into like partial word searches, ranking results, etc.

  • Thank you. I wasn't exactly sure where to start in terms of what to even research.

  • musicman21 (1/15/2009)


    What type of data should the keywords column be (text, varchar) or does it matter?

    Any help would be appreciated.

    I agree with what has been said about FTS, but for the datatype;

    The best datatpe for the keyword columns would be either Varchar or NVarchar depending on your need for Unicode support.

    Do not use TEXT datatype , use varchar(max) or nvarchar(max)

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply