I am thinking of implementing a string search similar to the command-t search in VIM. The context is almost the same: Finding Files in a Webapp.
It's not easy to explain how the command-t search works in a nutshell, so I try to give an example:
The following string:
/documents/companyname/contracts/staff/johndoe.pdf
searched by:
dpanystadoe
matches in that way:
/documents/companyname/contracts/staff/johndoe.pdf
This only makes sense in combination with a live autocomplete search, so it has to be really fast :).
Of course, the most naive approach is to use wildcards and build a search term like this: "%d%p%a%n%y%s%t%a%d%o%e%"
but we all know this is a bad idea as long as the data to query grows.
Any ideas how to start? Are there better ways to prepare the data? Which indexes could help?