954,585 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

PHP File Searching

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.

zixp
Newbie Poster
1 post since Feb 2005
Reputation Points: 10
Solved Threads: 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.

rice_web
Newbie Poster
11 posts since Jul 2004
Reputation Points: 10
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You