Page 1 of 1

Using INDEX in WHERE CLAUSE (database search)

Posted: Sat Jul 05, 2003 3:58 pm
by kendall
Hello,

Im have a table in which i have a FULLTEXT search ON (Title, Description) so that i can have these to colmuns indexed for searching the database

[quote]
My question is can i use the 'search' index name in a WHERE CLAUSE when querying search terms?
[/quote]

e.g.

[syntax=php]SELECT ID, Title, Description, Clicks, MATCH (Title, Description) AGAINST ('hotel, rooms, accomodations, guest') AS Score FROM online_directory WHERE INDEX(search) MATCH (Title,Description) AGAINST ('hotel, rooms, guest, accomodations') ORDER BY score DESC;[/syntax] P.S please excuse the code im just trying to explain my self in terms of coding :oops:

Kendall

Posted: Sat Jul 05, 2003 4:51 pm
by Stoker
You don't specify search on index, the RDBMS will take care of that for you, all indexes are transparent to any SELECT query (unless you use VERBOSE EXPLAIN or similar for debugging)..

You design your indexes to fit your queries..