Manticore Search Client
Project description
Manticore Asynchronous Python client
Сlient for Manticore Search.
Requirements.
Minimum Manticore Search version is >= 9.2.14 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-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
- AggComposite
- AggCompositeSource
- AggCompositeTerm
- AggDateHistogram
- AggHistogram
- AggTerms
- Aggregation
- AutocompleteRequest
- BoolFilter
- BulkResponse
- DeleteDocumentRequest
- DeleteResponse
- ErrorResponse
- FulltextFilter
- GeoDistance
- GeoDistanceLocationAnchor
- Highlight
- HighlightFieldOption
- HighlightFields
- HitsHits
- InsertDocumentRequest
- Join
- JoinCond
- JoinOn
- Knn
- KnnQuery
- Match
- MatchAll
- PercolateRequest
- PercolateRequestQuery
- QueryFilter
- Range
- ReplaceDocumentRequest
- ResponseError
- ResponseErrorDetails
- SearchQuery
- SearchRequest
- SearchResponse
- SearchResponseHits
- SourceRules
- SqlObjResponse
- SqlResponse
- SuccessResponse
- UpdateDocumentRequest
- UpdateResponse
Documentation For Authorization
Endpoints do not require authorization.
Author
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file manticoresearch_asyncio-2.0.0.tar.gz.
File metadata
- Download URL: manticoresearch_asyncio-2.0.0.tar.gz
- Upload date:
- Size: 49.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d005a1214f71a414012efef6e06dea34c6fcf82c9f0df1354551522086197d31
|
|
| MD5 |
a2b65bb91325d12aea3fdb3cde351c7a
|
|
| BLAKE2b-256 |
3fccf6dc8170c867a1a939cba743d574fe133e130a3532927a001fa7d814157c
|
File details
Details for the file manticoresearch_asyncio-2.0.0-py3-none-any.whl.
File metadata
- Download URL: manticoresearch_asyncio-2.0.0-py3-none-any.whl
- Upload date:
- Size: 102.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f5644bc8f7aab88a18b85dafd3619af86053af21c822e894e7d9703aba926f3
|
|
| MD5 |
9b3eeec310660f334e7db08998e361d4
|
|
| BLAKE2b-256 |
49ad44a7c2d95974abbd927c3c4400e4c761ee302bceebec34851fb2b011bdb1
|