If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Querying using metadata/keywords/semantics

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-05-11, 04:26
Finn2011 Finn2011 is offline
Registered User
 
Join Date: Mar 2011
Posts: 2
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
Reply With Quote
  #2 (permalink)  
Old 03-05-11, 06:13
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
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

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 03-05-11, 14:52
Finn2011 Finn2011 is offline
Registered User
 
Join Date: Mar 2011
Posts: 2
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On