MySQL: Something wrong with Fulltext search - Returning NO results

后端 未结 3 1883
忘掉有多难
忘掉有多难 2020-12-20 14:57

I have a table places(name vachar(50), address text, description text) engine = MYISAM and few records.

I have been trying to do some example in here!,

3条回答
  •  青春惊慌失措
    2020-12-20 15:06

    In addition to Marcus' answer:

    When I first started with FULLTEXT indexes in MySQL, I had problems with empty results - I was avoiding stop words and was also using long enough ones, so I was head-scratching a bit until I found this buried in the MySQL documentation:

    The 50% threshold has a significant implication when you first try full-text searching to see how it works: If you create a table and insert only one or two rows of text into it, every word in the text occurs in at least 50% of the rows. As a result, no search returns any results. Be sure to insert at least three rows, and preferably many more. Users who need to bypass the 50% limitation can use the boolean search mode

    This also explains why you got results (but with a "meaningless" score) when you set the query to operate IN BOOLEAN MODE

提交回复
热议问题