この ssql クエリで%
は、AGAINST
句で a を使用しています。
SELECT firstname,lastname,middlename,company_name,
primary_emailaddress,alternate_emailaddress,personal_address_line1,
personal_address_line2,personal_address_city,facebook_username,
twitter_username,googleplus_username,linkedin_username,
personal_website_url,birthday_month,notes,personal_address_zipcode,
company_address_zipcode,home_phonenumber,company_phonenumber,
cell_phonenumber,birthday_day,birthday_year,hash,image_file
FROM contacts
WHERE (
MATCH(
firstname,middlename,lastname,
primary_emailaddress,alternate_emailaddress,personal_address_line1,
personal_address_city,company_name,
company_address_line1,company_address_city,
facebook_username,twitter_username,googleplus_username,linkedin_username,
personal_website_url,birthday_month,notes
)
AGAINST ('someemail@email.com%' IN BOOLEAN MODE)
OR personal_address_zipcode REGEXP('(someemail@email.com*)')
OR company_address_zipcode REGEXP('(someemail@email.com*)')
OR home_phonenumber REGEXP('(someemail@email.com*)')
OR company_phonenumber REGEXP('(someemail@email.com*)')
OR cell_phonenumber REGEXP('(someemail@email.com*)')
OR birthday_day REGEXP('(someemail@email.com*)')
OR birthday_year REGEXP('(someemail@email.com*)')
)
AND addressbook_id = 4
この ssql クエリで*
は、AGAINST
句で a を使用しています。
SELECT firstname,lastname,middlename,company_name,
primary_emailaddress,alternate_emailaddress,personal_address_line1,
personal_address_line2,personal_address_city,facebook_username,
twitter_username,googleplus_username,linkedin_username,
personal_website_url,birthday_month,notes,personal_address_zipcode,
company_address_zipcode,home_phonenumber,company_phonenumber,
cell_phonenumber,birthday_day,birthday_year,hash,image_file
FROM contacts
WHERE (
MATCH(
firstname,middlename,lastname,
primary_emailaddress,alternate_emailaddress,personal_address_line1,
personal_address_city,company_name,
company_address_line1,company_address_city,
facebook_username,twitter_username,googleplus_username,linkedin_username,
personal_website_url,birthday_month,notes
)
AGAINST ('someemail@email.com*' IN BOOLEAN MODE)
OR personal_address_zipcode REGEXP('(someemail@email.com*)')
OR company_address_zipcode REGEXP('(someemail@email.com*)')
OR home_phonenumber REGEXP('(someemail@email.com*)')
OR company_phonenumber REGEXP('(someemail@email.com*)')
OR cell_phonenumber REGEXP('(someemail@email.com*)')
OR birthday_day REGEXP('(someemail@email.com*)')
OR birthday_year REGEXP('(someemail@email.com*)')
)
AND addressbook_id = 4
どちらも、コンテンツが atleast と正確に等しい場所だけを返しませんsomeemail@email.com
。comやemailなどですべてを返しています。どのような変更を加える必要がありますか? 一致列にはFULLTEXT
索引があります。