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?

https://wiki.archlinux.org/title/Locate

Something that uses Xapian as the back end, maybe?

There’s more than a few options or you could roll your own.

I guess it depends on scale.

  • FSearch

  • Recoll

  • TypeSense

What about simply shelling out to ripgrep?

@johntash@eviltoast.org
link
fedilink
English
13M

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.

Create a post

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don’t control.

Rules:

  1. Be civil: we’re here to support and learn from one another. Insults won’t be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it’s not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don’t duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

  • 1 user online
  • 191 users / day
  • 419 users / week
  • 1.14K users / month
  • 3.85K users / 6 months
  • 1 subscriber
  • 3.71K Posts
  • 74.6K Comments
  • Modlog