0

I am using php to search the file names of about 10,000 files. It works now, but for it to find the file the search phrase has to be found exactly within the file name. I would really like to get a fuzzy search feature workings, but things like similar_text() have crashed the site, I am assuming because they are so intensive. I have only tried similar_text and levenshtein. Any ideas are appreciated.

2
Contributors
1
Reply
2
Views
12 Years
Discussion Span
Last Post by rice_web
0

I am using php to search the file names of about 10,000 files. It works now, but for it to find the file the search phrase has to be found exactly within the file name. I would really like to get a fuzzy search feature workings, but things like similar_text() have crashed the site, I am assuming because they are so intensive. I have only tried similar_text and levenshtein. Any ideas are appreciated.

GREP can be your friend. Those preg functions might be able to pull off what you're looking for. For instance, you might put together a statement that takes vowels "/[aeiou]/" and replaces them with an identifier tag like "##" in both your query and your array of files. Then check each file for a preg_match. I suppose it's a bit complex a script, but it shouldn't at least crash.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.