views:

76

answers:

1

Hello,

Let's say I have a row:

一天吃一個蘋果

Someone enters as a query:

天蘋

Should I break up the characters in the query, and individually perform a LIKE % % match on each character against the row, or is there any easier way to get a row that contains one of the two characters? FULLTEXT won't work with CJK characters.

Thanks!

+1  A: 

Supposed you are searching for all query characters in a string and care about the character order.

First split the user query. Say 天蘋 to and .

Then construct a SQL query with LIKE and %, for example, WHERE x LIKE '%天%蘋%'.

OmniBus