I have a php webpage with a search bar that uses php code to search my server for files. It’s really slow. It’s a custom made thing I came up with years ago.
Are there any standalone python or c++ projects or libraries I can use that handle file searching? Plugging in a more optimal search function into this system would be a massive improvement but I can’t really replace this with a different system because reasons. If the only way to get such a feature is if I program it myself, then I’ll have to do that as it will be less work than migrating to a new system. But I’m pretty sure there exists something I could use to manage the search so I can shoehorn that in to the codebase instead of starting from scratch. Any suggestions?
Tl;dr I’m looking for a command line search program that runs on Linux and has some form of indexing.
Do you need more than locate offers?
I guess it depends on scale.
-
FSearch
-
Recoll
-
TypeSense
-
What about simply shelling out to ripgrep?
Something that uses Xapian as the back end, maybe?
There’s more than a few options or you could roll your own.
Do you need to search inside of files for text, or just file names?
If inside of files, something simple like ripgrep/ag/grep like someone else mentioned would be an easy option.
If just file names, why not create an index of filenames and search that instead?
If you need an advanced search, maybe ElasticSearch would work for you? You’d have to upload each file to the elasticsearch server though.