Forum Moderators: open
select * from vCars where Makes.Name=@search or Models.Name=@search
Where vCars is a View:
Select Cars.ID,Makes.Name,Models.Name from Cars inner join Makes on Cars.MakeID = Makes.ID inner join Models on Cars.ModelID = Model.ID
I dont quite know what you mean by fulltext search? You can either search using exact match using = like above or you can use wildcards for a partial matching
http: //dev.mysql.com/doc/refman/5.0/en/fulltext-search.html
and all the user comments? I remember seeing something in there about how it can be done - I think you either need to create fulltext indexes on every column and merge the results, or merge the column data into one "big" column and create your fulltext index on that.
Indeexes are just physical design / optimisation , it doesnt really affect how you write your queries for this particular problem.
aspdaddy, the OP is talking about full-text indexing (i.e. MySQL functionality which allows you to add some sort of search facility to your website) not normal indexing (for performance benefits).
I think the only solution is to have one (full-text) index on each table, execute the same query on each table and merge the resultsets using union. Finally, sort the combined resultset by the relevance column.
arran.