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 more documentation on making request on ES-backed collections
- Loading branch information
Showing
5 changed files
with
60 additions
and
55 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
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Development Tools | ||
----------------- | ||
|
||
"nefertari.index" console script can be used to manually index models from your database engine to Elasticsearch. | ||
|
||
You can run it like so:: | ||
|
||
$ nefertari.index --help | ||
|
||
The options available are: | ||
|
||
**config**: specify ini file to use (required). E.g.:: | ||
|
||
$ nefertari.index --config local.ini | ||
|
||
**models**: list of dotted paths of models to index. Models must be subclasses of ESBaseDocument. E.g.:: | ||
|
||
$ nefertari.index --config local.ini --models example_api.model.Story | ||
|
||
**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). |
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Making requests | ||
=============== | ||
|
||
Query syntax | ||
------------ | ||
|
||
=============================== =========== | ||
url parameter description | ||
=============================== =========== | ||
``_m=<method>`` to tunnel any http method using GET, e.g. _m=POST | ||
``_limit=<n>`` to limit the returned collection to <n> results (default: 20, max limit: 100 for unauthenticated users) | ||
``_sort=<field_name>`` to sort collection by <field_name> | ||
``_start=<n>`` to start collection from the <n>th resource | ||
``_page=<n>`` to start collection at page <n> (n * _limit) | ||
``_fields=<field_list>`` to display only specific fields, use ``-`` before field names to exclude those fields, e.g. ``_fields=-descripton`` | ||
=============================== =========== | ||
|
||
Query syntax for ElasticSearch | ||
------------------------------ | ||
|
||
Additional parameters are available when using an ElasticSearch-enabled collection (see **ESBaseDocument** in the `Wrapper API <database_backends.html#wrapper-api>`_ section of this documentation). | ||
|
||
=============================== =========== | ||
url parameter description | ||
=============================== =========== | ||
``<field_name>=<keywords>`` to filter a collection using full-text search on <field_name>, ElasticSearch operators [#]_ can be used, e.g. ``?title=foo AND bar`` | ||
``q=<keywords>`` to filter a collection using full-text search on all fields | ||
``_search_fields=<field_list>`` use with ``?q=<keywords>`` to restrict search to specific fields | ||
=============================== =========== | ||
|
||
.. [#] The full syntax of ElasticSearch querying is beyond the scope of this documentation. You can read more on the `ElasticSearch Query String Query <http://www.elastic.co/guide/en/elasticsearch/reference/1.x/query-dsl-query-string-query.html>`_ page and more specifically on `Ranges <http://www.elastic.co/guide/en/elasticsearch/reference/1.x/query-dsl-query-string-query.html#_ranges_2>`_ to do things like: ``?date=[2014-01-01 TO *]`` |