Provides a fast, easy to install and simple to use search engine for text, but optimized for source code. An alternative, OpenGrok, requires too much time to install (though it may be worth it for some), but is more feature rich. Text Sherlock will give you a much easier setup, a text indexer, and a web app interface for searching with very little effort.
Instructions:
- Download Sherlock source from GitHub.
- Extract/place the Sherlock source code in the desired (install) directory. This will be where Sherlock lives.
- Run
sh setup/virtualenv-setup.shto setup an isolated environment and download core packages. - Configure settings. The defaults in
settings.pyprovide documentation for each setting.- Copy
example.local_settings.ymltolocal_settings.yml. - Override/copy any setting from
settings.pytolocal_settings.yml(change the values as needed). All YAML keys/options must be lowercase.
- Copy
- Run
source sherlock_env/bin/activateto enter the virtual environment. - Run
python main.py --index updateor--index rebuildto index the path specified in the settings. Watch indexing output. - Run
python main.py --runserverto start the web server. - Go to
http://localhost:7777to access the web interface. Uses the Bootstrap toolkit for it's UI.
You may need to install some packages before a Ubuntu installation will run without error.
- Install curl:
sudo apt-get install curl - Install uuid libs:
sudo apt-get install uuid-dev - Install python dev:
sudo apt-get install python-dev
Includes:
- Settings/Configuration
- See
settings.pyfor details.
- See
- Setup script (read contents of script for more information)
- Run
virtualenv-setup.shto perform an isolated installation.
- Run
- Main controller script
- Run
main.py -hfor more information.
- Run
- End-to-end interface
- Indexing and searching text (source code). Built-in support for whoosh (fast searching) or xapian (much faster searching).
- Easily extend indexing or searching via custom backends.
- Front end web app served using werkzeug or cheroot.
werkzeugis for development to small traffic.cherootis the high-performance, pure-Python HTTP server used by CherryPy.
- Settings and configuration using Python.
- Indexing and searching text (source code). Built-in support for whoosh (fast searching) or xapian (much faster searching).
Features:
Append to document URL.
- To highlight lines, append to URL:
&hl=3,7,12-14,21 - To jump to a line, append to end of URL:
#line-3
In settings.py:
- Change the
default_indexeranddefault_searchervalues to match the name given to the backend.- Possible values:
whooshthe default, no extra work needed.xapianmust be installed separately using the includedsetup/install-xapian.shsetup script.
- Possible values:
Text Sherlock has built-in support for werkzeug and cheroot WSGI compliant servers.
In settings.py:
- Change the
server_typevalue to one of the available server types.- Possible values:
default, werkzeug web server (default).cheroot, production ready web server.
- Possible values:
Requires Python 3.5+
- https://pygments.org/
- http://docs.peewee-orm.com/
- https://cheroot.cherrypy.org/
- https://xapian.org/
- https://pyyaml.org/wiki/PyYAMLDocumentation
- https://zeptojs.com
- Provide an easy to setup, fast, and adequate text search engine solution.
- Be a respectable alternative to OpenGrok.
- Influence the OpenGrok contributors to provide a simpler setup process.
- I successfully setup two installations of OpenGrok on CentOS and Ubuntu 11.x. Each time it took more than two hours. Text Sherlock setup takes less than 5 minutes (excluding package download time).