Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> SQL question related to searching Keywords
Hello,
I am developing a web-search engine for a web-site. Client is HTML and i
connect to an Oracle database through JAVA Servlets/JDBC. Part of the
web site is stored in a database so i decided instead of searching the
full-text to add a "Keywords" attribute to my tables and search only the
keywords. It is supposed to be more efficient...is it ?
My question is how should i write the SQL statement that compares the
user's entry in the HTML textbox to the Keywords column. If for example
the keywords are stored in an VARCHAR2 column named KEYWORDS in a comma
delimited fromat : keyword1,keyword2,keyword3 and the user enters in
the text box 'Alex'.
SELECT * FROM TableName WHERE 'Alex' LIKE .........what ?
If i could parse and tokenize the KEYWORDS column values then i could
for example write :
SELECT * FROM TableName WHERE ('Alex' LIKE keyword1 OR 'Alex' LIKE
keyword2 OR 'Alex' LIKE keyword3)
Is there a SQL function that can help ?
Or is there a different approach to searching keyword ?
Not to mention the case where the user enters more than one word in the
text box......
I also thought of storing the Keywords values in a separate table which will have a many-to-one relationship to my master table. In that case every keyword willl be stored in a separate record and i don't need to parse and tokenize... but i will incurr the performance degradarion because of the join operation.
Thanks,
Alex.
. Received on Tue Dec 14 1999 - 22:55:59 CST
![]() |
![]() |