Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Commit

Permalink
adding post2api to development tools section of the doc
Browse files Browse the repository at this point in the history
  • Loading branch information
jstoiko committed Apr 21, 2015
1 parent e23b088 commit ea5559e
Showing 1 changed file with 24 additions and 13 deletions.
37 changes: 24 additions & 13 deletions docs/source/development_tools.rst
Original file line number Diff line number Diff line change
@@ -1,24 +1,35 @@
Development Tools
-----------------
=================

"nefertari.index" console script can be used to manually index models from your database engine to Elasticsearch.
Indexing in ElasticSearch
-----------------------------

``nefertari.index`` console script can be used to manually (re-)index models from your database engine to ElasticSearch.

You can run it like so::

$ nefertari.index --help
$ nefertari.index --config local.ini --models example_api.model.Story

The options available are:
The available options are:

**config**: specify ini file to use (required). E.g.::
--config specify ini file to use (required)
--models list of dotted paths of models to index. Models must be subclasses of ESBaseDocument.
--params URL-encoded parameters for each module
--quiet "quiet mode" (surpress output)
--index Specify name of index. E.g. the slug at the end of http://localhost:9200/example_api
--chunk Index chunk size
--force Force re-indexation of all documents in database engine (defaults to False)

$ nefertari.index --config local.ini
Importing bulk data
-------------------

**models**: list of dotted paths of models to index. Models must be subclasses of ESBaseDocument. E.g.::
``nefertari.post2api`` console script can be used to POST data to your api. It may be useful to import data in bulk, e.g. mock data.

$ nefertari.index --config local.ini --models example_api.model.Story
You can run it like so::

$ nefertari.post2api -f ./users.json -u http://localhost:6543/api/users

The available options are:

**params**: URL-encoded parameters for each module.
**quiet**: "quiet mode" (surpress output)
**index**: Specify name of index. E.g. the slug at the end of http://localhost:9200/example_api
**chunk**: Index chunk size.
**force**: Force re-indexation of all documents in database engine (defaults to False).
-f specify a json file containing an array of json objects
-u specify the url of the collection you wish to POST to

0 comments on commit ea5559e

Please sign in to comment.