2016-10-25 6 views
0

私は、テーブル内のレコードに次のクエリを実行すると:mysqlのブールモード選択クエリ

SELECT TRIM(city_table.City_Name) 
    as label,city_table.Area_Name, city_table.Area_Code, city_table.City_Code as `City`, 
    city_table.Country_Code ,city_table.Country_Name as CountryName, 
    city_table.City_Code as `value` 
FROM `city_table` 
where MATCH(city_table.SearchString) AGAINST('+al* +ain*' IN BOOLEAN MODE) 

データが返されないし。そして私は、「アル・アイン」を持っていることがわかりますが、私は同じクエリを実行すると:

SELECT TRIM(city_table.City_Name) 
    as label,city_table.Area_Name, city_table.Area_Code, city_table.City_Code as `City`, 
    city_table.Country_Code ,city_table.Country_Name as CountryName, city_table.City_Code as `value` 
FROM `city_table` 
where MATCH(city_table.SearchString) 
AGAINST('+dub*' IN BOOLEAN MODE) 

レコードが正しく返されます。

は同様に、レコードがために返却されていません。

SELECT TRIM(city_table.City_Name) 
    as label,city_table.Area_Name, city_table.Area_Code, city_table.City_Code as `City`,city_table.Country_Code , 
    city_table.Country_Name as CountryName, city_table.City_Code as `value` 
FROM `city_table` where MATCH(city_table.SearchString) 
AGAINST('+umm*' IN BOOLEAN MODE) 

しかし、「GHA」や「AJM」のような別の文字列と同じクエリがレコードを返します。

テーブルに 'umm'と 'al'のレコードがありますが、まだ表示されていません。私は表示するレコードの画像を添付することができませんが、私はテーブルに次のフィールドを持っています。

City_Name City_Code Area_NameArea_Code Country_Code SearchString Country_Name。

答えて

0

私は何かが目に見えて間違って見えることはありませんが、デフォルトでFULLTEXT索引で索引付けされる単語の長さの最小値は4文字であることに注意してください。時にはそれはうまくいきます、他の時はありません! Potentially relevant info here.

+0

my.cnfファイルをft_min_word_len = 1に変更しますが、まだ表示されません。奇妙なことはラベルとしてSELECT TRIM(city_table.City_Name)、city_table.Area_Name、city_table.Area_Code、city_table.City_Codeを 'City'、city_table.Country_Code、city_table.Country_NameをCountryName、city_table.City_Codeを' value' FROM 'city_table'ここでMATCH(city_table.SearchString)AGAINST( '+ The Palm +' BOOLEAN MODE)順序はcity_table.priority desc limit 0,30でこのクエリは機能しません。その3つ以上の文字 –

+0

"The Palm"のように1つの列の項目に都市​​名文字列がありますか? – Chris