Grano ElasticSearch Support
grano is a toolkit for building journalistic social network analysis applications on the web. This package contains full-text search support based on ElasticSearch.
grano-elasticsearch requires that you have installed and configured
grano. Please refer to grano's documentation
for further instructions. Afterwards, install the
package (from PyPI or source) into the same virtual environment. You will
also need to install and configure ElasticSearch.
To enable this plugin, add the entry
ui to the
PLUGINS variable in
grano settings file. If you have no other plugins installed,
PLUGINS = ['es_boot', 'es_entity_indexer', 'es_project_indexer']
This plugin provides the following public API to expose full-text search:
Full-text search API for entitues. Given a query, the API will return a set of ElasticSearch results (i.e. not complete entity serializations). Standard :ref:`pager` arguments are available.
qthe term to be searched.
<name>for the given value.
facetadd the value of the argument as a facet field. This argument can be supplied multiple times to have more than one facet.
facet-sizecan be used to specify the number of results to be returned for each
In order to manage the index, the plugin exposes a set of management commands. Some examples:
# re-index all projects: $ grano es_index # re-index a specific project (by slug): $ grano es_index -p my_project # delete all data in the index: $ grano es_delete # delete all data in a specific project: $ grano es_delete -p my_project
grano-elasticsearch will deploy itself and add its endpoint to
grano API. To specify the name of the ElasticSearch index, you can set
ES_INDEX setting in your
grano configuration file. If no index name
is specified, the application's name (
APP_NAME) will be used.