Skip to main content

Manticore Search Client

Project description

Manticore Python client

Сlient for Manticore Search.

Requirements.

Minimum Manticore Search version is >= 2.5.1 with HTTP protocol enabled.

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/manticoresoftware/manticoresearch-python.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/manticoresoftware/manticoresearch-python.git)

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:

import manticoresearch
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 instances of API classes
    indexApi = manticoresearch.IndexApi(api_client)
    searchApi = manticoresearch.SearchApi(api_client)
    utilsApi = manticoresearch.UtilsApi(api_client)

    try:
        # Perform insert and search operations    
        newDoc = {"title" : "Crossbody Bag with Tassel", "price": 19.85}
        insert_request = InsertDocumentRequest(index="products", doc=newDoc)
        indexApi.insert(insert_request)
        
        # Check out the structure of the autocreated 'products' table
        sql_response = utilsApi.sql('DESC products');
        print("The response of UtilsApi->sql:\n")
        pprint(sql_response) 

        newDoc = {"title" : "Pet Hair Remover Glove", "price": 7.99}
        insert_request = InsertDocumentRequest(index="products", doc=newDoc)
        indexApi.insert(insert_request)
        
        query_highlight = Highlight()
        query_highlight.fields = {"title":{}}
        search_query = SearchQuery(query_string="@title bag")
        search_request = SearchRequest(index="products", query=search_query, highlight=query_highlight)
        search_response = searchApi.search(search_request)    
        print("The response of SearchApi->search:\n")
        pprint(search_response)

        # Alternatively, you can pass all request arguments as a complex JSON object        
        indexApi.insert({"index": "products", "doc" : {"title" : "Crossbody Bag with Tassel", "price" : 19.85}})
        indexApi.insert({"index": "products", "doc" : {"title" : "Pet Hair Remover Glove", "price" : 7.99}})
        search_response = searchApi.search({"index": "products", "query": {"query_string": "@title bag"}, "highlight":{"fields":{"title":{}}}})
        print("The response of SearchApi->search:\n")
        pprint(search_response)
    except ApiException as e:
        print("Exception when calling Api method: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to http://127.0.0.1:9308

Class Method HTTP request Description
IndexApi bulk POST /bulk Bulk table operations
IndexApi delete POST /delete Delete a document in a table
IndexApi insert POST /insert Create a new document in a table
IndexApi partial_replace POST /{table}/_update/{id} Partially replaces a document in a table
IndexApi replace POST /replace Replace new document in a table
IndexApi update POST /update Update a document in a table
SearchApi autocomplete POST /autocomplete Performs an autocomplete search on a table
SearchApi percolate POST /pq/{table}/search Perform reverse search on a percolate table
SearchApi search POST /search Performs a search on a table
UtilsApi sql POST /sql Perform SQL requests
UtilsApi token POST /token Create or rotate a bearer token

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

basicAuth

  • Type: HTTP basic authentication

bearerAuth

  • Type: Bearer authentication

Author

info@manticoresearch.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

manticoresearch-11.1.1.tar.gz (57.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

manticoresearch-11.1.1-py3-none-any.whl (125.9 kB view details)

Uploaded Python 3

File details

Details for the file manticoresearch-11.1.1.tar.gz.

File metadata

  • Download URL: manticoresearch-11.1.1.tar.gz
  • Upload date:
  • Size: 57.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for manticoresearch-11.1.1.tar.gz
Algorithm Hash digest
SHA256 e418e65468aa7753d3bb391742e85c59ee6424f6b722cefff16c6531d2d431b8
MD5 23bbd7f50554d1779107a518519e0929
BLAKE2b-256 0a4a606a9dc72a62642f945799cdbe91e3807501e2940d73632e2fa89e2aa02d

See more details on using hashes here.

File details

Details for the file manticoresearch-11.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for manticoresearch-11.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ea4206e86655c6707e3e8b9e25446025503ce147cd882755abd4026718efa4ee
MD5 14e1c0e8fd64dc6ba011801f5a2d2b6e
BLAKE2b-256 32ba08f6c27bb2ac947f2df7196a2b1f8bc30b6c6cab12a07f882c004c1ea42b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page