Friends, the situation is, you need to find in the database any words that match the words from the query. Here is an example request:

$filter .=" AND MATCH (owner) AGAINST ('*".$word."*' IN BOOLEAN MODE)"; 

Currently $ word = "LLC";

In the database, the owner field is equal, for example, to NWTcom LLC. As a result of this request, I get nothing. If $ word = "north" for example, then the string finds.

If for example my owner field is "1 FMS", then when the word $ word = "1" or for example "FMS" is the result of 0 lines. Ie the search does not happen.

The question is how to edit the query in such a way that he would look for all possible options for 1 or the second word, but not the exact entry? It is important that the search be carried out also by numbers.

  • Perhaps the problem is that the full-text search by default only works on 4+ characters? Those. 3 characters is not enough to search, do you need 4 or more? - Miron

1 answer 1

Full TEXT searches by words. The word is usually understood as a collection of at least 3 non-whitespace characters (but this can be changed) http://dev.mysql.com/doc/refman/5.5/en/fulltext-fine-tuning.html

Judging by your requests, you do not really need a full-text search. You more LIKE fit.