Guten tag.
By the table structure (X_posts, post_title, post_content) it looks like you're using WordPress.
Irrespective, I can do the following with your current code and database (MySQL):
- Sanitize the search phrase (prevent injection)
- Tokenize the search phrase (split into individual keywords)
- Alias the given umlauts and double-s with their Latin equivalents
- Optimize the PHP code
- Maintain your relevancy weighting
With database access, I can perform some further optimizations by adding indices and maybe fulltext type index, but MySQL is still not ideal for this. MySQL will be a bottleneck.
I would propose/recommend to use SOLR as your search provider, which is purpose-designed for just such search cases, and would be far more performant, and can in addition return spelling-corrected results with spelling suggestions (whereas MySQL doesn't handle fuzzy search very well).
Perhaps we can implement this MySQL-based search first and then explore SOLR in the near future. There are some very low cost providers (5 Euro/mth) .