How to allow fulltext searching with hyphens in the search query

From here http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html One solution to find a word with a dashes or hyphens in is to use FULL TEXT SEARCH IN BOOLEAN MODE, and to enclose the word with the hyphen / dash in double quotes. Or from here http://bugs.mysql.com/bug.php?id=2095 There is another workaround. It was recently added to the manual: ” Modify a … Read more

php (fuzzy) search matching

Unfortunately, doing this in PHP is prohibitively expensive (high CPU and memory utilization.) However, you can certainly apply the algorithm to small data sets. To specifically expand on how you can create a server meltdown: couple of built-in PHP functions will determine “distance” between strings: levenshtein and similar_text. Dummy data: (pretend they’re news headlines) $titles … Read more

Using Full-Text Search in SQL Server 2008 across multiple tables, columns

Using FREETEXTTABLE, you just need to design some algorithm to calculate the merged rank on each joined table result. The example below skews the result towards hits from the book table. SELECT b.Name, a.Name, bkt.[Rank] + akt.[Rank]/2 AS [Rank] FROM Book b INNER JOIN Author a ON b.AuthorID = a.AuthorID INNER JOIN FREETEXTTABLE(Book, Name, @criteria) … Read more

PDO and MySQL Fulltext searches

This is unfortunately a weird exception to the use of query parameters (edit: but apparently not in the most recent point-release of each MySQL branch, see below). The pattern in AGAINST() must be a constant string, not a query parameter. Unlike other constant strings in SQL queries, you cannot use a query parameter here, simply … Read more