tenerife
tenerife

Reputation: 21

MySQL fulltext searching: fulltext and INT columns in the same query

I have a fulltext index on column "SEARCH". But the query contains additional "AND" condition where tinyint column "VEGETARIAN" is involved.

What is the best solution for this situation? To leave as it is - fulltext index just on "SEARCH" column? To create one more index on "VEGETARIAN" column?

$result = mysql_query( "SELECT title FROM recipes where 
match(search) against('$query' in boolean mode) and vegetarian='1' 
limit $start, $step");     

Thanks.

Upvotes: 1

Views: 1029

Answers (1)

Jaydee
Jaydee

Reputation: 4158

I doubt indexing vegetarian will have any effect as the text search will have to be run first and then the non vegetarian rows filtered out. Best way with this kind of thing is try it and see if it works.

Upvotes: 0

Related Questions