Skip to main content

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

Release files for manticoresearch 11.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for manticoresearch 11.2.0
File Size Uploaded
manticoresearch-11.2.0.tar.gz 58.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for manticoresearch 11.2.0
File Interpreter ABI Platform
manticoresearch-11.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 186.5 kB

Release files / manticoresearch-11.2.0.tar.gz

Download URL manticoresearch-11.2.0.tar.gz
Size 58.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a20b18c94685b7a55ab6512ccf993cb678dd6bee7791db63a17af57ce08f2f5b
BLAKE2b-256 checksum
How to use checksums
715e0e6aa8a8d96f4159b81eb0b14b5f94b223e3658e19fad9c148b3ad8a7f4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.20

Release files / manticoresearch-11.2.0-py3-none-any.whl

Download URL manticoresearch-11.2.0-py3-none-any.whl
Size 127.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
31eb5f657fddec1ab1adcd4889df75ee18b9bbdbeeaf55f8b0c3b0df79a5569f
BLAKE2b-256 checksum
How to use checksums
c757acef3de1240cae04be3a5724c54b747daf556bbca402c4f1913bb0026bc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.20

Release history Release notifications | RSS feed

This release

11.2.0 This release

2 release files

11.1.1

2 release files

11.1.0

2 release files

11.0.0

2 release files

10.0.2

2 release files

10.0.0

2 release files

9.0.0

2 release files

8.0.0

2 release files

7.0.0

2 release files

6.0.0

2 release files

4.0.0

2 release files

3.3.1

2 release files

3.3.0

2 release files

2.2.0

2 release files

2.0.0

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page