Python client for Manticore Search
Project description
Manticore Python client
Сlient for Manticore Search.
Requirements.
Minimum Manticore Search version is >= 2.5.1 with HTTP protocol enabled.
Manticore Search | manticoresearch-python | Python |
---|---|---|
>= 6.2.0 | 4.0.0 | >= 3.4 |
>= 6.2.0 | 3.3.1 | >= 3.4 |
>= 4.2.1 | 2.0.x | >= 3.4 |
>= 4.0.2 < 4.2.1 | 1.0.6 | >= 3.4 |
>= 2.5.1 < 4.0.2 | 1.0.5 | >= 2.7 |
Installation & Usage
pip install
Install the manticoresearch
package with pip
pip install manticoresearch
Then import the package:
import manticoresearch
Setuptools
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install
to install the package for all users)
Then import the package:
import manticoresearch
Getting Started
Please follow the installation procedure and then run the following:
from __future__ import print_function
import time
import manticoresearch
from manticoresearch import *
from manticoresearch.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://127.0.0.1:9308
# See configuration.py for a list of all supported configuration parameters.
configuration = manticoresearch.Configuration(
host = "http://127.0.0.1:9308"
)
# Enter a context with an instance of the API client
with manticoresearch.ApiClient(configuration) as api_client:
# Create an instance of the IndexApi API class
api_instance = manticoresearch.IndexApi(api_client)
body = "["'{\"insert\": {\"index\": \"test\", \"id\": 1, \"doc\": {\"title\": \"Title 1\"}}},\\n{\"insert\": {\"index\": \"test\", \"id\": 2, \"doc\": {\"title\": \"Title 2\"}}}'"]" # str |
try:
# Bulk index operations
api_response = api_instance.bulk(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling IndexApi->bulk: %s\n" % e)
# Create an instance of the Search API class
api_instance = manticoresearch.SearchApi(api_client)
# Create SearchRequest
search_request = SearchRequest()
search_request.index='test'
search_request.fullltext_filter=QueryFilter('Title 1')
# The example passes only required values which don't have defaults set
try:
# Perform a search
api_response = api_instance.search(search_request)
pprint(api_response)
except manticoresearch.ApiException as e:
print("Exception when calling SearchApi->search: %s\n" % e)
Documentation
Full documentation on the API Endpoints and Models used is available in docs folder as listed below.
Manticore Search server documentation: https://manual.manticoresearch.com.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
manticoresearch-4.0.0.tar.gz
(64.5 kB
view hashes)
Built Distribution
Close
Hashes for manticoresearch-4.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af3ccea764657b9a0c9c76734b999709eced77464bf38a2c3c4d0c6ecb0ead8c |
|
MD5 | 22a5545d72262be4f6bf8edb20fb204c |
|
BLAKE2b-256 | d6037476506408787328035ebf871cd8bf3f3347c2f4af6bda6aa8eb87020c25 |