Task: search for best matching results for a name-search with wildcard inside a db with ~40Million names. e.g. query='John' results might be 'John', 'Johnny', 'Smith John', 'ajohn'
Candidates: MySQL Full-text, Sphinx and Lucene.
Observation: I assume they all work with an inverted index, which might not be the best solution for such short "documents" (names), and a trie might be a lot more suitable.
Assuming this observation is correct, do these tools have configurations to be more suitable for my case? Are there other tools that can integrate easily in PHP?
Thanks.