This repository has been archived by the owner on Sep 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding post2api to development tools section of the doc
- Loading branch information
Showing
1 changed file
with
24 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |