Are you happy with your logging solution? Would you help us out by taking a 30-second survey? Click here

hound

Lightning fast code searching made easy

Subscribe to updates I use hound


Statistics on hound

Number of watchers on Github 3612
Number of open issues 88
Average time to close an issue about 2 months
Main language JavaScript
Average time to merge a PR 6 days
Open pull requests 32+
Closed pull requests 33+
Last commit almost 2 years ago
Repo Created almost 5 years ago
Repo Last Updated over 1 year ago
Size 1.93 MB
Organization / Authoretsy
Latest Releasev0.2.0
Contributors29
Page Updated
Do you use hound? Leave a review!
View open issues (88)
View hound activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating hound for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

Hound

Build Status Join the chat at https://gitter.im/etsy/Hound

Hound is an extremely fast source code search engine. The core is based on this article (and code) from Russ Cox: Regular Expression Matching with a Trigram Index. Hound itself is a static React frontend that talks to a Go backend. The backend keeps an up-to-date index for each repository and answers searches through a minimal API. Here it is in action:

Hound Screen Capture

Quick Start Guide

Using Go Tools

  1. Use the Go tools to install Hound. The binaries houndd (server) and hound (cli) will be installed in your $GOPATH.
go get github.com/etsy/hound/cmds/...
  1. Create a config.json in a directory with your list of repositories.

  2. Run the Hound server with houndd and you should see output similar to:

    2015/03/13 09:07:42 Searcher started for statsd
    2015/03/13 09:07:42 Searcher started for Hound
    2015/03/13 09:07:42 All indexes built!
    2015/03/13 09:07:42 running server at http://localhost:6080...
    

Using Docker (1.4+)

  1. Create a config.json in a directory with your list of repositories.

  2. Run

    docker run -d -p 6080:6080 --name hound -v $(pwd):/data etsy/hound
    

You should be able to navigate to http://localhost:6080/ as usual.

Running in Production

There are no special flags to run Hound in production. You can use the --addr=:6880 flag to control the port to which the server binds. Currently, Hound does not supports SSL/TLS as most users simply run Hound behind either Apache or nginx. Adding TLS support is pretty straight forward though if anyone wants to add it.

Why Another Code Search Tool?

We've used many similar tools in the past, and most of them are either too slow, too hard to configure, or require too much software to be installed. Which brings us to...

Requirements

  • Go 1.4+

Yup, that's it. You can proxy requests to the Go service through Apache/nginx/etc., but that's not required.

Support

Currently Hound is only tested on MacOS and CentOS, but it should work on any *nix system. Hound on Windows is not supported but we've heard it compiles and runs just fine.

Hound supports the following version control systems:

  • Git - This is the default
  • Mercurial - use "vcs" : "hg" in the config
  • SVN - use "vcs" : "svn" in the config
  • Bazaar - use "vcs" : "bzr" in the config

See config-example.json for examples of how to use each VCS.

Private Repositories

There are a couple of ways to get Hound to index private repositories:

  • Use the file:// protocol. This allows you to index a local clone of a repository. The downside here is that the polling to keep the repo up to date will not work. (This also doesn't work on local folders that are not of a supported repository type.)
  • Use SSH style URLs in the config: "url" : "git@github.com:foo/bar.git". As long as you have your SSH keys set up on the box where Hound is running this will work.

Keeping Repos Updated

By default Hound polls the URL in the config for updates every 30 seconds. You can override this value by setting the ms-between-poll key on a per repo basis in the config. If you are indexing a large number of repositories, you may also be interested in tweaking the max-concurrent-indexers property. You can see how these work in the example config.

Editor Integration

Currently the following editors have plugins that support Hound:

Hacking on Hound

Editing & Building

Requirements:

Hound includes tools to make building locally easy. It is recommended that you use these tools if you are working on Hound. To get setup and build, just run the following commands:

git clone https://github.com/etsy/hound.git hound/src/github.com/etsy/hound
cd hound
src/github.com/etsy/hound/tools/setup
make

Testing

There are an increasing number of tests in each of the packages in Hound. Please make sure these pass before uploading your Pull Request. You can run the tests with the following command.

make test

Working on the web UI

Hound includes a web UI that is composed of several files (html, css, javascript, etc.). To make sure hound works seamlessly with the standard Go tools, these resources are all bundled inside of the houndd binary. Note that changes to the UI will result in local changes to the ui/bindata.go file. You must include these changes in your Pull Request.

To make development easier, there is a flag that will read the files from the file system (allowing the much-loved edit/refresh cycle).

bin/houndd --dev

Get in Touch

Created at Etsy by:

hound open issues Ask a question     (View All Issues)
  • about 3 years index directory with file://: does it work?
  • about 3 years Does the parser support comments in config.json
  • about 3 years Interactive Services Detection
  • over 3 years Exceed limit results
  • over 3 years i wrote a hound search plugin for hain
  • over 3 years Option to generate the search index separately
  • over 3 years Add option for alternative link (docs, for example)
  • over 3 years Authentication and Entitlements
  • over 3 years Hound doesn't consider "?q=foo+bar" equivalent to "?q=foo%20bar"
  • over 3 years Add ability to index an externally maintained repository
  • over 3 years Add ability to turn of "git clone --depth=1", it's sometimes quite expensive
  • over 3 years As of GitLab 8.6, cloning repos throws a http 500 error
  • over 3 years Add a "tree" view
  • over 3 years url-pattern: {url} - url:port is converted to url/port
  • over 3 years Only one file instead of the whole repository
  • over 3 years Incorrect URL when file path contains a plus sign
  • over 3 years Don't require hound to be hosted at /
  • over 3 years Add a 'use string literally' search option
  • almost 4 years User defined global defaults for poll frequence and vcs
  • almost 4 years "Repos Summary" - Feature search for quick navigation
  • almost 4 years feature request: perforce support
  • almost 4 years Client browser hangs if the search query is ".*"
  • almost 4 years Treating a single "repo" as multiple
  • almost 4 years Hardcoded urls paths
  • almost 4 years Add sane logging.
  • about 4 years Allow the user to filter on path names through the UI
  • about 4 years Hound Git Configuration
  • about 4 years Add the ability to filter whitelist/blacklist file types
  • about 4 years Hound's UI has poor accessibility
  • about 4 years Add overview UI for searches with a lot of hits
hound open pull requests (View All Pulls)
  • Added options to speficy defaults for poll frequence and vcs
  • Show matches count in results
  • Delete and re-clone the repo if pull fails
  • Rsync
  • Update style add in Dark theme
  • Update to React 0.14.0
  • Minimal docker image
  • Add tool to seed a config.json file with all repositories owned by an org
  • Support for local VCS allowing to index local path
  • Refactor Hound's web UI to accept non-regex queries
  • Added "none" type VCS for indexing local directories
  • Implemented user preferences for setting ignore case and auto hide advanced on search.
  • Hide Advanced search after query submit
  • add ability to specify branches - fixes #9
  • Limit index with exclusion/inclusion patterns
  • Option to specify branch + bitbucket-specific URL/anchor defaults.
  • fix #209: correctly decode the query parameters
  • Commit
  • Add branching to git
  • Add a search option to exclude file paths with a regexp
  • OpenShift Template
  • Always use relative URLs for assets
  • ui: Add option to hide/show an entire repo
  • ui: collapse and expand files
  • Add ability to use custom branch from vcs config for git
  • UI: Make repo and file titles sticky
  • Merge two MAKEFILEs in to one
  • Added Visual Studio Code plugin to README
  • improve parsing of fully-protocoled URLs
  • Added hound config generator
  • Docker improvements
  • Remove surrounding / from file filter
hound questions on Stackoverflow (View All Questions)
  • Elixir & hound headless browser
  • How Shazam or Sound Hound works?
hound list of languages used
hound latest release notes
v0.2.0 Bug fixes and some new features

In case people want to download a pre-built binary, here's a new release incorporating all of the early fixes and feature additions.

0.1 First release

Pre-built binary attached in case you don't want to build it yourself.

Other projects in JavaScript