GithubHelp home page GithubHelp logo

l1kw1d / hound Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hound-search/hound

0.0 2.0 0.0 1.33 MB

Lightning fast code searching made easy

License: MIT License

Makefile 0.07% Ruby 0.12% JavaScript 73.78% CSS 2.68% HTML 0.16% Go 22.98% Shell 0.21%

hound's Introduction

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

Preferred Method

This is the preferred approach, since the binaries are generally easier to work with, and make will build both the server and the CLI binaries at the same time.

  1. Clone the repo: git clone https://github.com/etsy/Hound.git
  2. Edit config-example.json to add the repos you want: cd Hound && vim config-example.json
  3. Rename the (now edited) config file: mv config-example.json config.json
  4. make
  5. ./bin/houndd
  6. See Hound in action in your browser at http://localhost:6080/

Using only Go tools.

Alternatively, you can avoid the use of make and just use go tools.

  1. Clone the repo: git clone https://github.com/etsy/Hound.git
  2. Edit config-example.json to add the repos you want: cd Hound && vim config-example.json
  3. Rename the (now edited) config file: mv config-example.json config.json
  4. Set your GOPATH: export GOPATH=`pwd`
  5. Run the server: go run src/hound/cmds/houndd/main.go
  6. See Hound in action in your browser at http://localhost:6080/

Why can't I use go get?

That's coming, we just need to make it easier to bundle the javascript/css assets so it all works seamlessly.

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

Hard Requirements

  • Go 1.3+

Optional, Recommended Software

  • Make (for building the binaries, not strictly required)
  • nodejs (for the command line react-tools)

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

Docker

  • docker 1.4+

You should follow the quickstart guide up to step (3) and then run:

$ docker build -t houndd .
$ docker run -it --rm -p 0.0.0.0:6080:6080 --name houndd houndd

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

Support

Currently Hound is only tested on MacOS and CentOS, but it should work on any *nix system. There is no plan to support Windows, and we've heard that it fails to compile on Windows, but we would be happy to accept a PR that fixes this!

Right now Hound supports git and mercurial, and SVN support is being added. By default Hound expects git repositories, so to use mercurial you have to specify "vcs" : "hg" in the config as shown in config-example.json.

Private Repositories

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

  • Use the file:// protocol. This allows you to index any local folder, so you can clone the repository locally and then reference the files directly. The downside here is that the polling to keep the repo up to date will not work.
  • Use SSH style URLs in the config: "url" : "[email protected]:foo/bar.git". As long as you have your SSH keys set up on the box where Hound is running this will work. There is currently an issue with URLs in this case that we hope to fix soon.

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. You can see how this works in the example config.

Editor Integration

Currently the following editors have plugins that support Hound:

Hacking on Hound

Building

make

This will build ./bin/houndd which is the server binary and ./bin/hound which is the command line client.

Running in development

./bin/houndd

This will start up the combined server and indexer. The first time you start the server, it will take a bit of time to initialize your data directory with the repository data. You can access the web frontend at http://localhost:6080/

Running in production

./bin/houndd --prod --addr=address:port

The will start up the combined server/indexer and build all static assets in production mode. The default addr is ":6080", and thus the --addr flag can be used to have the server listen on a different port.

Get in Touch

IRC: #codeascraft on freenode

Created at Etsy by:

hound's People

Contributors

adrienp avatar belak avatar fxb avatar jklein avatar jsok avatar kellegous avatar linc01n avatar lupino avatar michalsanger avatar mlr avatar paulwellnerbou avatar reinhardt1053 avatar ryoung786 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.