Did you know ... Search Documentation:
Pack plasticsearch -- prolog/plasticsearch/plasticsearch.pl
PublicShow source

This is basically a Prolog version of Elasticsearch Python APIs.

author
- Hongxin Liang
See also
- https://github.com/elastic/elasticsearch-py
license
- Apache License Version 2.0
To be done
- Sniffing is not supported.
 plasticsearch(-Ps) is det
 plasticsearch(-Ps, +Options) is det
 plasticsearch(-Ps, +Hosts, +Options) is det
Create a new Plasticsearch instance.

Default options are:

dead_timeout(60)
retry_on_timeout(false)
max_retries(3)
timeout_cutoff(5)
random_selector(false)
retry_on_status([503, 504])

If no Hosts are given, http://localhost:9200 will be used by default. If only hostname is provided, port 9200 will be used and http will be assumed. Otherwise = uri_components(Scheme, Authority, Path, Search, Fragment) = can be used for fine-grained configuration.

 destroy(+Ps) is det
Destory a Plasticsearch instance.
 ping(+Ps) is semidet
 ping(+Ps, +Params) is semidet
Returns True if the cluster is up, False otherwise.
 info(+Ps, -Reply) is semidet
 info(+Ps, +Params, -Reply) is semidet
Get the basic info from the current cluster.
 create(+Ps, +Index, +DocType, +ID, +Body, -Reply) is semidet
 create(+Ps, +Index, +DocType, +ID, +Params, +Body, -Reply) is semidet
Adds a typed document in a specific index, making it searchable. Behind the scenes this predicate calls index/7 with = op_type=create = as additional parameter. See here.
 index(+Ps, +Index, +DocType, +ID, +Body, -Reply) is semidet
 index(+Ps, +Index, +DocType, +ID, +Params, +Body, -Reply) is semidet
Adds or updates a typed document in a specific index, making it searchable. See here.
 exists(+Ps, +Index, +DocType, +ID) is semidet
 exists(+Ps, +Index, +DocType, +ID, +Params) is semidet
Returns a boolean indicating whether or not given document exists in Elasticsearch. See here.
 get(+Ps, +Index, +DocType, +ID, -Reply) is semidet
 get(+Ps, +Index, +DocType, +ID, +Params, -Reply) is semidet
Get a typed document from the index based on its id. See here.
 get_source(+Ps, +Index, +DocType, +ID, -Reply) is semidet
 get_source(+Ps, +Index, +DocType, +ID, +Params, -Reply) is semidet
Get the source of a document by it's index, type and id. See here.
 mget(+Ps, +Index, +DocType, +Body, -Reply) is semidet
 mget(+Ps, +Index, +DocType, +Params, +Body, -Reply) is semidet
Get multiple documents based on an index, type (optional) and ids. See here.
 update(+Ps, +Index, +DocType, +ID, +Body, -Reply) is semidet
 update(+Ps, +Index, +DocType, +ID, +Params, +Body, -Reply) is semidet
Update a document based on a script or partial data provided. See here.
 search(+Ps, +Index, +DocType, +Body, -Reply) is semidet
 search(+Ps, +Index, +DocType, +Params, +Body, -Reply) is semidet
Execute a search query and get back search hits that match the query. See here.
 search_shards(+Ps, +Index, +DocType, -Reply) is semidet
 search_shards(+Ps, +Index, +DocType, +Params, -Reply) is semidet
The search shards api returns the indices and shards that a search request would be executed against. This can give useful feedback for working out issues or planning optimizations with routing and shard preferences. See here.
 search_template(+Ps, +Index, +DocType, +Body, -Reply) is semidet
 search_template(+Ps, +Index, +DocType, +Params, +Body, -Reply) is semidet
A query that accepts a query template and a map of key/value pairs to fill in template parameters. See here.
 explain(+Ps, +Index, +DocType, +ID, +Body, -Reply) is semidet
 explain(+Ps, +Index, +DocType, +ID, +Params, +Body, -Reply) is semidet
The explain api computes a score explanation for a query and a specific document. This can give useful feedback whether a document matches or didn't match a specific query. See here.
 scroll(+Ps, +ID, -Reply) is semidet
 scroll(+Ps, +ID, +Params, -Reply) is semidet
Scroll a search request created by specifying the scroll parameter. See here.
 clear_scroll(+Ps, +ID, +Body, -Reply) is semidet
 clear_scroll(+Ps, +ID, +Params, +Body, -Reply) is semidet
Clear the scroll request created by specifying the scroll parameter to search. See here.
 delete(+Ps, +Index, +DocType, +ID, -Reply) is semidet
 delete(+Ps, +Index, +DocType, +ID, +Params, -Reply) is semidet
Delete a typed JSON document from a specific index based on its id. See here.
 count(+Ps, +Index, +DocType, +Body, -Reply) is semidet
 count(+Ps, +Index, +DocType, +Params, +Body, -Reply) is semidet
Execute a query and get the number of matches for that query. See here.
 bulk(+Ps, +Index, +DocType, +Body, -Reply) is semidet
 bulk(+Ps, +Index, +DocType, +Params, +Body, -Reply) is semidet
Perform many index/delete operations in a single API call. See here.
 msearch(+Ps, +Index, +DocType, +Body, -Reply) is semidet
 msearch(+Ps, +Index, +DocType, +Params, +Body, -Reply) is semidet
Execute several search requests within the same API. See here.
 delete_by_query(+Ps, +Index, +DocType, +Body, -Reply) is semidet
 delete_by_query(+Ps, +Index, +DocType, +Params, +Body, -Reply) is semidet
Delete documents from one or more indices and one or more types based on a query. See here.
 suggest(+Ps, +Index, +Body, -Reply) is semidet
 suggest(+Ps, +Index, +Params, +Body, -Reply) is semidet
The suggest feature suggests similar looking terms based on a provided text by using a suggester. See here.
 percolate(+Ps, +Index, +DocType, +ID, +Body, -Reply) is semidet
 percolate(+Ps, +Index, +DocType, +ID, +Params, +Body, -Reply) is semidet
The percolator allows to register queries against an index, and then send percolate requests which include a doc, and getting back the queries that match on that doc out of the set of registered queries. See here.
 mpercolate(+Ps, +Index, +DocType, +Body, -Reply) is semidet
 mpercolate(+Ps, +Index, +DocType, +Params, +Body, -Reply) is semidet
The percolator allows to register queries against an index, and then send percolate requests which include a doc, and getting back the queries that match on that doc out of the set of registered queries. See here.
 count_percolate(+Ps, +Index, +DocType, +ID, +Body, -Reply) is semidet
 count_percolate(+Ps, +Index, +DocType, +ID, +Params, +Body, -Reply) is semidet
The percolator allows to register queries against an index, and then send percolate requests which include a doc, and getting back the queries that match on that doc out of the set of registered queries. See here.
 mlt(+Ps, +Index, +DocType, +ID, +Body, -Reply) is semidet
 mlt(+Ps, +Index, +DocType, +ID, +Params, +Body, -Reply) is semidet
Get documents that are "like" a specified document. See here.
 termvectors(+Ps, +Index, +DocType, +ID, +Body, -Reply) is semidet
 termvectors(+Ps, +Index, +DocType, +ID, +Params, +Body, -Reply) is semidet
Returns information and statistics on terms in the fields of a particular document. The document could be stored in the index or artificially provided by the user (Added in 1.4). Note that for documents stored in the index, this is a near realtime API as the term vectors are not available until the next refresh. See here.
 termvector(+Ps, +Index, +DocType, +ID, +Body, -Reply) is semidet
 termvector(+Ps, +Index, +DocType, +ID, +Params, +Body, -Reply) is semidet
Returns information and statistics on terms in the fields of a particular document. The document could be stored in the index or artificially provided by the user (Added in 1.4). Note that for documents stored in the index, this is a near realtime API as the term vectors are not available until the next refresh. See here.
 mtermvectors(+Ps, +Index, +DocType, +Body, -Reply) is semidet
 mtermvectors(+Ps, +Index, +DocType, +Params, +Body, -Reply) is semidet
Multi termvectors API allows to get multiple termvectors based on an index, type and id. See here.
 benchmark(+Ps, +Index, +DocType, +Body, -Reply) is semidet
 benchmark(+Ps, +Index, +DocType, +Params, +Body, -Reply) is semidet
The benchmark API provides a standard mechanism for submitting queries and measuring their performance relative to one another. See here.
 abort_benchmark(+Ps, +Name, -Reply) is semidet
 abort_benchmark(+Ps, +Name, +Params, -Reply) is semidet
Aborts a running benchmark. See here.
 list_benchmark(+Ps, +Index, +DocType, -Reply) is semidet
 list_benchmark(+Ps, +Index, +DocType, +Params, -Reply) is semidet
View the progress of long-running benchmarks. See here.
 put_script(+Ps, +Lang, +ID, +Body, -Reply) is semidet
 put_script(+Ps, +Lang, +ID, +Params, +Body, -Reply) is semidet
Create a script in given language with specified ID. See here.
 get_script(+Ps, +Lang, +ID, -Reply) is semidet
 get_script(+Ps, +Lang, +ID, +Params, -Reply) is semidet
Retrieve a script from the API. See here.
 delete_script(+Ps, +Lang, +ID, -Reply) is semidet
 delete_script(+Ps, +Lang, +ID, +Params, -Reply) is semidet
Remove a stored script from elasticsearch. See here.
 put_template(+Ps, +ID, +Body, -Reply) is semidet
 put_template(+Ps, +ID, +Params, +Body, -Reply) is semidet
Create a search template. See here.
 get_template(+Ps, +ID, -Reply) is semidet
 get_template(+Ps, +ID, +Params, -Reply) is semidet
Retrieve a search template. See here.
 delete_template(+Ps, +ID, -Reply) is semidet
 delete_template(+Ps, +ID, +Params, -Reply) is semidet
Delete a search template. See here.
 search_exists(+Ps, +Index, +DocType, +Body, -Reply) is semidet
 search_exists(+Ps, +Index, +DocType, +Params, +Body, -Reply) is semidet
The exists API allows to easily determine if any matching documents exist for a provided query. See here.

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

 plasticsearch(Arg1, Arg2)
 plasticsearch(Arg1, Arg2, Arg3)
 ping(Arg1, Arg2)
 info(Arg1, Arg2, Arg3)
 create(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7)
 index(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7)
 exists(Arg1, Arg2, Arg3, Arg4, Arg5)
 get(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6)
 get_source(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6)
 mget(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6)
 update(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7)
 search(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6)
 search_shards(Arg1, Arg2, Arg3, Arg4, Arg5)
 search_template(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6)
 explain(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7)
 scroll(Arg1, Arg2, Arg3, Arg4)
 clear_scroll(Arg1, Arg2, Arg3, Arg4, Arg5)
 delete(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6)
 count(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6)
 bulk(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6)
 msearch(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6)
 delete_by_query(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6)
 suggest(Arg1, Arg2, Arg3, Arg4, Arg5)
 percolate(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7)
 mpercolate(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6)
 count_percolate(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7)
 mlt(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7)
 termvectors(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7)
 termvector(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7)
 mtermvectors(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6)
 benchmark(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6)
 abort_benchmark(Arg1, Arg2, Arg3, Arg4)
 list_benchmark(Arg1, Arg2, Arg3, Arg4, Arg5)
 put_script(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6)
 get_script(Arg1, Arg2, Arg3, Arg4, Arg5)
 delete_script(Arg1, Arg2, Arg3, Arg4, Arg5)
 put_template(Arg1, Arg2, Arg3, Arg4, Arg5)
 get_template(Arg1, Arg2, Arg3, Arg4)
 delete_template(Arg1, Arg2, Arg3, Arg4)
 search_exists(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6)