Restful json CherryPy server.
Usage: python server.py [index_directory ...]
| -h, --help | show this help message and exit |
| -r, --read-only | |
| expose only read methods; no write lock | |
| -c CONFIG, --config=CONFIG | |
| optional configuration file or json object of global params | |
| -p FILE, --pidfile=FILE | |
| store the process id in the given file | |
| -d, --daemonize | |
| run the server as a daemon | |
| --autoreload=SECONDS | |
| automatically reload modules; replacement for engine.autoreload | |
| --autorefresh=SECONDS | |
| automatically refresh index | |
Transform responses into json format. Specify tools.json.indent for pretty printing.
Only allow methods specified in tools.allow.methods.
Return response time in headers.
Dispatch root with a delegated Searcher.
Return ids or documents.
Return list of doc ids.
| return: | [int,... ] |
|---|
Return document mappings, optionally selecting stored, multi-valued, and cached indexed fields.
&fields=chars,... &fields.multi=chars,... &fields.indexed=chars[:chars],...
| return: | {string: string|array,... } |
|---|
Return index information.
Return a mapping of the directory to the document count.
| return: | {string: int} |
|---|
Refresh index.
Reopen searcher, optionally reloading caches, and return document count.
&filters&sorters&spellcheckers
| return: | int |
|---|
Run query and return documents.
Return list of document objects and total doc count.
| return: | {
“query”: string,
“count”: int|null,
“maxscore”: float|null,
“docs”: [{“__id__”: int, “__score__”: float, “__highlights__”: {string: array,... }, string: string|array,... },... ],
“facets”: {string: {string: int,... },... },
“groups”: [{“count”: int, “value”: value, “docs”: [{... },... ]},... ]
“spellcheck”: {string: {string: [string,... ],... },... },
}
|
|---|
Return data about indexed terms.
Return field names, with optional selection.
&option=chars
| return: | [string,... ] |
|---|
Return term values for given field name.
| return: | [string,... ] |
|---|
Return term values (wildcards, slices, or fuzzy terms) for given field name.
| return: | [string,... ] |
|---|
Return spellchecked term values ordered by decreasing document frequency. Prefixes (*) are optimized to be suitable for real-time query suggestions; all terms are cached.
| return: | [string,... ] |
|---|
Return document count with given term.
| return: | int |
|---|
Return document ids with given term.
| return: | [int,... ] |
|---|
Return document ids and frequency counts for given term.
| return: | [[int, int],... ] |
|---|
Return document ids and positions for given term.
| return: | [[int, [int,... ]],... ] |
|---|
Bases: server.WebSearcher
Dispatch root which extends searcher to include write methods.
Commit index changes.
Add or return documents. See WebSearcher.docs() for GET method.
Add documents to index.
docs=[{string: string|array,... },... ]
Return or store a field’s parameters.
Return known field names.
| return: | [string,... ] |
|---|
Set and return parameters for given field name.
store=chars
index=chars
termvector=chars
| return: | {“store”: string, “index”: string, “termvector”: string} |
|---|
Run or delete a query. See WebSearcher.search() for GET method.
Attach root, subscribe to plugins, and start server.
| Parameters: |
|
|---|