Skip to main content

Manticore Search Client

Project description

Manticore Asynchronous Python client

Сlient for Manticore Search.

❗ WARNING: this is a development version of the client. The latest release's readme is https://github.com/manticoresoftware/manticoresearch-python-asyncio/tree/2.0.0

Requirements.

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

*manticoresearch-python Manticore Search Python Compatibility
manticoresearch-asyncio-devel dev (latest development version) 3.4 or newer ✅ Fully Compatible
2.0.0 or newer 17.5.1 or newer 3.4 or newer ✅ Fully Compatible
2.0.0 or newer 9.2.14 to 17.5.1 3.4 or newer ⚠️ Partially Compatible
1.0.0 to 2.0.0 17.5.1 or newer 3.4 or newer ⚠️ Partially Compatible
1.0.0 to 2.0.0 9.2.14 to 17.5.1 3.4 or newer ✅ Fully Compatible

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-asyncio.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/manticoresoftware/manticoresearch-python-asyncio.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

Documentation For Models

Documentation For Authorization

Endpoints do not require authorization.

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_asyncio_devel-2.0.0.tar.gz (49.5 kB view details)

Uploaded Source

Built Distribution

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

manticoresearch_asyncio_devel-2.0.0-py3-none-any.whl (102.6 kB view details)

Uploaded Python 3

File details

Details for the file manticoresearch_asyncio_devel-2.0.0.tar.gz.

File metadata

File hashes

Hashes for manticoresearch_asyncio_devel-2.0.0.tar.gz
Algorithm Hash digest
SHA256 73e9fc96378754e000dc8e227a97982dbdc60a4cccf42252d9f093a307d13423
MD5 7855ea526252e115cea9f33a20fb2592
BLAKE2b-256 f666f49fde3a1089fa934660a67f6c1d8ba7027299a80d8c23ab8a09a2f33f82

See more details on using hashes here.

File details

Details for the file manticoresearch_asyncio_devel-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for manticoresearch_asyncio_devel-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 79d9600f2623df503391175e8d99e0991b7a550d8ad9388c44b9204324e7192b
MD5 e88393bf6722f917ba40798961651a2c
BLAKE2b-256 b7922ed294b4ede4fa86ebe3fc1d713c1ade216f79abf8d8069c16c909879973

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