All Projects → hound-search → Hound

hound-search / Hound

Licence: mit
Lightning fast code searching made easy

Programming Languages

javascript
184084 projects - #8 most used programming language
go
31211 projects - #10 most used programming language
Less
1899 projects
CSS
56736 projects
shell
77523 projects
HTML
75241 projects

Projects that are alternatives of or similar to Hound

Jsep
JavaScript Expression Parser
Stars: ✭ 515 (-89.61%)
Mutual labels:  hacktoberfest
Devdocs
Magento Developer Documentation
Stars: ✭ 521 (-89.49%)
Mutual labels:  hacktoberfest
Notebooks
code for deep learning courses
Stars: ✭ 522 (-89.47%)
Mutual labels:  hacktoberfest
Space Nerds In Space
Multi-player spaceship bridge simulator. Captain your starship through adventures with your friends. See https://smcameron.github.io/space-nerds-in-space
Stars: ✭ 516 (-89.59%)
Mutual labels:  hacktoberfest
Apisprout
Lightweight, blazing fast, cross-platform OpenAPI 3 mock server with validation
Stars: ✭ 519 (-89.53%)
Mutual labels:  hacktoberfest
Free Courses
Free IT courses
Stars: ✭ 522 (-89.47%)
Mutual labels:  hacktoberfest
Devjoke
#DevJoke. Submit a PR if you know a good dev joke.
Stars: ✭ 516 (-89.59%)
Mutual labels:  hacktoberfest
Bpmn Js
A BPMN 2.0 rendering toolkit and web modeler.
Stars: ✭ 5,592 (+12.86%)
Mutual labels:  hacktoberfest
Pydot
Python interface to Graphviz's Dot language
Stars: ✭ 518 (-89.55%)
Mutual labels:  hacktoberfest
Autoblue Ms17 010
This is just an semi-automated fully working, no-bs, non-metasploit version of the public exploit code for MS17-010
Stars: ✭ 522 (-89.47%)
Mutual labels:  hacktoberfest
Teresa
Open source tool to deploy apps to Kubernetes clusters
Stars: ✭ 517 (-89.57%)
Mutual labels:  hacktoberfest
Algorithmic Pseudocode
This repository contains the pseudocode(pdf) of various algorithms and data structures necessary for Interview Preparation and Competitive Coding
Stars: ✭ 519 (-89.53%)
Mutual labels:  hacktoberfest
Eigengrau S Essential Establishment Generator
A town generator that is suitable for out of the box play in any fantasy TTRPG setting.
Stars: ✭ 523 (-89.45%)
Mutual labels:  hacktoberfest
Indy Sdk
Everything needed to build applications that interact with an Indy distributed identity ledger.
Stars: ✭ 516 (-89.59%)
Mutual labels:  hacktoberfest
Reakit
Toolkit for building accessible rich web apps with React
Stars: ✭ 5,265 (+6.26%)
Mutual labels:  hacktoberfest
Guide
The official guide for discord.js, created and maintained by core members of its community
Stars: ✭ 512 (-89.67%)
Mutual labels:  hacktoberfest
Microsoft Graph Toolkit
Authentication Providers and UI components for Microsoft Graph 🦒
Stars: ✭ 518 (-89.55%)
Mutual labels:  hacktoberfest
Bigcache
Efficient cache for gigabytes of data written in Go.
Stars: ✭ 5,304 (+7.04%)
Mutual labels:  hacktoberfest
Binaryen
Compiler infrastructure and toolchain library for WebAssembly
Stars: ✭ 5,294 (+6.84%)
Mutual labels:  hacktoberfest
Skll
SciKit-Learn Laboratory (SKLL) makes it easy to run machine learning experiments.
Stars: ✭ 523 (-89.45%)
Mutual labels:  hacktoberfest

Hound

Build Status .github/workflows/go.yaml

⚠️ Hound's default branch name has changed! ⚠️

We renamed our default branch from master to main on February 24, 2021. We used Github's branch renaming feature, which means that any open pull requests should be automatically re-targeted, and web requests pointing to code on the master branch should redirect as expected. This change should mostly be invisible, but you will need to update any code that explicitly relies on the existence of Hound's master branch.

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. Install Go if you don't have it already. Hound requires version 1.4 or later. You might also want to define a GOPATH environment variable) (it defaults to $HOME/go if you don't explicitly have one set). If everything is installed properly, go version should print out the installed version of go.

  2. Use the Go tools to install Hound. The binaries houndd (server) and hound (cli) will be installed in your $GOPATH/bin directory. Your $GOPATH should be in your $PATH (echo $PATH to check).

go get github.com/hound-search/hound/cmds/...
  1. Create a config.json file and use it to list your repositories. Check out our example-config.json to see how to set up various types of repositories. For example, we can configure Hound to search its own source code using the config found in default-config.json:
{
  "dbpath" : "db",
  "repos" : {
    "Hound" : { "url" : "https://github.com/etsy/hound.git" }
  }
}

A complete list of available config options can be found here.
3. Run the Hound server with houndd in the same directory as your config.json. 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
  1. By default, hound hosts a web ui at http://localhost:6080 . Open it in your browser, and start searching.

Using Docker (1.4+)

  1. Install the docker if you don't have it. We need at least Docker >= 1.14.

  2. Create a config.json file and use it to list your repositories. Check out our example-config.json to see how to set up various types of repositories. For example, we can configure Hound to search its own source code using the config found in default-config.json.

  3. 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 support TLS as most users simply run Hound behind either Apache or nginx. However, we are open to contributions to add TLS support.

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.13+

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 (although it helps to to exclude your data folder from Windows Search Indexer).

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.) If you're using Docker, you must mount a volume to your repository (e.g., -v $(pwd)/src:/src) and use the relative path to the repo in your configuration.
  • 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.

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 a Makefile to aid in building locally, but it depends on the source being added to a proper Go workspace so that Go tools work accordingly. See Setting GOPATH for further details about setting up your Go workspace. With a GOPATH set, the following commands will build hound locally.

git clone https://github.com/hound-search/hound.git ${GOPATH}/src/github.com/hound-search/hound
cd ${GOPATH}/src/github.com/hound-search/hound
make

If this is your only Go project, you can set your GOPATH just for Hound:

git clone https://github.com/hound-search/hound.git src/github.com/hound-search/hound
GOPATH=$(pwd) make -C src/github.com/hound-search/hound

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. To run the entire test suite, use:

make test

If you want to just run the JavaScript test suite, use:

npm test

Any Go files that end in _test.go are assumed to be test files. Similarly, any JavaScript files that ends in .test.js are automatically run by Jest, our test runner. Tests should live next to the files that they cover. Check out Jest's docs for more details on writing Jest tests, and check out Go's testing docs for more details on testing Go code.

You need to install Node.js >= 12 and install jest by npm install jest to run the JS tests.

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 bundle UI changes in ui/bindata.go use:

make ui

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

First you should ensure you have all the dependencies installed that you need by running:

make dev

Then run the hound server with the --dev option:

bin/houndd --dev

Get in Touch

Created at Etsy by:

Hound is maintained by:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].