Did you know ... Search Documentation:
Packs (add-ons) for SWI-Prolog

Package "plasticsearch"

Title:Elasticsearch client API
Rating:Not rated. Create the first rating!
Latest version:0.1
SHA1 sum:92b08c6a789e9b5b1530e711e8bf0f3281c6af23
Author:Hongxin Liang <hongxin.liang@ericsson.com>
Maintainer:Hongxin Liang <hongxin.liang@ericsson.com>
Packager:Hongxin Liang <hongxin.liang@ericsson.com>
Home page:https://github.com/EricssonResearch/plasticsearch
Download URL:https://github.com/EricssonResearch/plasticsearch/archive/v0.1.zip

Reviews

No reviews. Create the first review!.

Details by download location

VersionSHA1#DownloadsURL
0.173dc647be4d2744b8921fd8e2be6637f4cd485311https://github.com/EricssonResearch/plasticsearch.git
7f10842c29aaecb7d380083ddafa50d1a50d48f71https://github.com/EricssonResearch/plasticsearch.git
92b08c6a789e9b5b1530e711e8bf0f3281c6af2312https://github.com/EricssonResearch/plasticsearch.git

plasticsearch

Plasticsearch is an Elasticsearch Client implemented in Prolog.

The implementation is based on Python Elasticsearch Client. Architecture, design, and modularization are kept the same as Python Elasticsearch Client in order to make it easier to use for developers who are familiar with Python Elasticsearch Client.

Installation

Using SWI-Prolog 7 or later.

?- pack_install('https://github.com/EricssonResearch/plasticsearch.git').

Source code available and pull requests accepted here.

author
- Hongxin Liang <hongxin.liang@ericsson.com>
license
- Apache License Version 2.0

Examples

To create an index and add a document:

:- use_module(library(plasticsearch/sugar)).
:- use_module(library(plasticsearch/plasticsearch)).

create :-
    plasticsearch(Ps, ['http://192.121.150.101:8200', 'http://192.121.150.101:9200'],
        [dead_timeout(10)]),
    Ps.indices.create(es_test, _{refresh:true},
        _{settings: _{index: _{'mapping.allow_type_wrapper': true}}},
        CreateReply),
    get_current_time_as_atom(Time1),
    Ps.create(es_test, tweet, '', _{refresh:true}, _{
            tweet:_{user:kimchy1, post_date:Time1, message:'trying out Elasticsearch'}
        }, CreateIndexReply1),
    Ps.indices.delete(es_test, DeleteReply),
    destroy(Ps).

For more examples, please check source code under examples directory.

License

Copyright 2015 Ericsson

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Contents of pack "plasticsearch"

Pack contains 15 files holding a total of 106K bytes.