Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2011
    Posts
    4

    Querying using metadata/keywords/semantics

    Hi,

    I wonder if anyone can suggest how i go about structuring this database and query please?

    I have a search screen with multiple input field options which queries one table in a database by building a SELECT query from whichever fields were input. The problem i have is with the textual search. There is currently a text field so if the user inputs "vat" it searches a description column in the mySQL DB "where description LIKE %vat%". This is working fine.

    However i need it to be intelligent to search for similar meanings e.g. if vat is input, also look for "%value added tax" in the description. There is a specific group of words i need this to work for not a full word dictionary. The idea i had was to build a separate 2 column table which has "vat" in one column and "value added tax" in another and query this table first to see if the word in the text field is present and then obtain its alternative meaning (column 2). Then with the result do "where description LIKE %vat% OR where description LIKE %value added tax%".

    Is there a better or more standard way of doing this? I've read lots on using XML, metadata etc but nothing seems to nail it down specifically.

    Many Thanks

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by Finn2011 View Post
    The idea i had was to build a separate 2 column table which has "vat" in one column and "value added tax" in another and query this table first to see if the word in the text field is present and then obtain its alternative meaning (column 2). Then with the result do "where description LIKE %vat% OR where description LIKE %value added tax%".
    this is a really good idea

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Mar 2011
    Posts
    4
    Thanks for that, good to know i'm on the right track.

    Does anyone know if this is a typical method of using keywords to search databases? or if there is alternative ways?

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •