Skip to content

Commit 3ecd8fc

Browse files
committed
Updated docs and Readme
1 parent 14d6c73 commit 3ecd8fc

File tree

8 files changed

+44
-36
lines changed

8 files changed

+44
-36
lines changed

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
# manticoresearch
2-
Low-level client for Manticore Search.
2+
Сlient for Manticore Search.
33

44

55

66
## Requirements.
77

8-
Python 2.7 and 3.4+.
9-
10-
Minimum Manticore Search version is > 2.5.1 with HTTP protocol enabled.
8+
Minimum Manticore Search version is >= 2.5.1 with HTTP protocol enabled.
119

1210
| Manticore Search | manticoresearch-python | Python |
1311
| ----------------- | ------------------------ | ------------- |
@@ -82,7 +80,7 @@ with manticoresearch.ApiClient(configuration) as api_client:
8280
# Documentation
8381

8482

85-
Full documentation is available in [docs](https://github.com/manticoresoftware/manticoresearch-python/tree/master/docs) folder.
83+
Full documentation on the API Endpoints and Models used is available in [docs](https://github.com/manticoresoftware/manticoresearch-python/tree/master/docs) folder as listed below.
8684

8785
Manticore Search server documentation: https://manual.manticoresearch.com.
8886

@@ -98,7 +96,7 @@ Class | Method | HTTP request | Description
9896
*IndexApi* | [**replace**](docs/IndexApi.md#replace) | **POST** /replace | Replace new document in an index
9997
*IndexApi* | [**update**](docs/IndexApi.md#update) | **POST** /update | Update a document in an index
10098
*SearchApi* | [**percolate**](docs/SearchApi.md#percolate) | **POST** /pq/{index}/search | Perform reverse search on a percolate index
101-
*SearchApi* | [**search**](docs/SearchApi.md#search) | **POST** /search | Performs a search
99+
*SearchApi* | [**search**](docs/SearchApi.md#search) | **POST** /search | Performs a search on an index
102100
*UtilsApi* | [**sql**](docs/UtilsApi.md#sql) | **POST** /sql | Perform SQL requests
103101

104102

docs/SearchApi.md

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ All URIs are relative to *http://127.0.0.1:9308*
44

55
Method | HTTP request | Description
66
------------- | ------------- | -------------
7-
[**search**](SearchApi.md#search) | **POST** /search | Performs search
8-
[**percolate**](SearchApi.md#percolate) | **POST** /pq/{index}/search | Perform reverse search on a percolate index
7+
[**search**](SearchApi.md#search) | **POST** /search | Performs a search on an index.
8+
[**percolate**](SearchApi.md#percolate) | **POST** /pq/{index}/search | Perform a reverse search on a percolate index
99

1010

1111
## **search**
1212
> SearchResponse search(search_request)
1313
14-
Performs search
14+
Performs a search on an index.
1515

16-
17-
Expects an object with mandatory properties:
18-
* the index name
16+
The method expects an object with the following mandatory properties:
17+
18+
* the name of the index to search
19+
1920
* the match query object
2021

21-
Example:
22-
22+
Here is an example search request:
2323
```
2424
{
2525
'index':'movies',
@@ -48,13 +48,20 @@ Example:
4848

4949
Alternatively, you can use auxiliary objects to build your search query. For details, see the documentation on [**SearchRequest**](SearchRequest.md)
5050

51-
It responds with an object with:
52-
- an array with hits (matched documents) found
53-
- if the query is timed out
54-
- time of execution
55-
- if profiling is enabled, an additional array with profiling information attached
51+
The method returns an object with the following properties:
52+
53+
- took: the time taken to execute the search query.
54+
- timed_out: a boolean indicating whether the query timed out.
55+
- hits: an object with the following properties:
56+
- total: the total number of hits found.
57+
- hits: an array of hit objects, where each hit object represents a matched document. Each hit object has the following properties:
58+
- _id: the ID of the matched document.
59+
- _score: the score of the matched document.
60+
- _source: the source data of the matched document.
5661

62+
In addition, if profiling is enabled, the response will include an additional array with profiling information attached.
5763

64+
Here is an example search response:
5865
```
5966
{
6067
'took':10,
@@ -150,13 +157,13 @@ No authorization required
150157
## **percolate**
151158
> SearchResponse percolate(index,percolate_request)
152159
153-
Perform reverse search on a percolate index
160+
Perform a reverse search on a percolate index
154161

155162
Performs a percolate search.
156163
This method must be used only on percolate indexes.
157164

158-
Expects two parameters: the index name and an object with array of documents to be tested.
159-
An example of the documents object:
165+
Expects two parameters: the index name and an object with an array of documents to search with.
166+
Here is an example of the document object:
160167

161168
```
162169
{

docs/SearchRequest.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ Name | Type | Description | Notes
7676

7777
api_response = api_instance.search(search_req)
7878
pprint(api_response)
79+
```
7980

8081
### Sort
8182
```python
@@ -89,9 +90,11 @@ Name | Type | Description | Notes
8990
```
9091

9192
### SortOrder
92-
### SortMVA
9393

9494
[[SortOrder - input parameters]](SortOrder.md)
95+
96+
### SortMVA
97+
9598
[[SortMVA - input parameters]](SortMVA.md)
9699

97100
[[Docs on sorting in Manticore Search Manual]](https://manual.manticoresearch.com/Searching/Sorting_and_ranking#HTTP)
@@ -190,7 +193,7 @@ Name | Type | Description | Notes
190193

191194
[[QueryFilter - input parameters]](QueryFilter.md)
192195
```python
193-
#Using a QueryFilter object
196+
#Using a QueryFilter object
194197
search_req.fulltext_filter = manticoresearch.model.QueryFilter('test')
195198

196199
api_response = api_instance.search(search_req)
@@ -227,7 +230,7 @@ Name | Type | Description | Notes
227230

228231
[[MatchOpFilter - input parameters]](MatchOpFilter.md)
229232
```python
230-
#Using a MatchOpFilter object
233+
#Using a MatchOpFilter object
231234
search_req.fulltext_filter = manticoresearch.model.MatchOpFilter('test1 test2', 'title', 'and')
232235

233236
api_response = api_instance.search(search_req)

manticoresearch/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"""
66
Manticore Search Client
77
8-
Low-level client for Manticore Search. # noqa: E501
8+
Сlient for Manticore Search. # noqa: E501
99
10-
The version of the OpenAPI document: 1.0.0
10+
The version of the OpenAPI document: 3.3.0
1111
1212
Generated by: https://openapi-generator.tech
1313
"""

manticoresearch/api/search_api.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@ def percolate_with_http_info(self, index, percolate_request, **kwargs): # noqa:
184184

185185

186186
def search(self, search_request, **kwargs): # noqa: E501
187-
"""Performs a search # noqa: E501
187+
"""Performs a search on an index # noqa: E501
188188
189-
Expects an object with mandatory properties: * the index name * the match query object Example : ``` { 'index':'movies', 'query': { 'bool': { 'must':[{'query_string':' movie'}] } }, 'script_fields': { 'myexpr': { 'script':{'inline':'IF(rating>8,1,0)' } }, 'sort': [ {'myexpr':'desc'}, {'_score':'desc'} ], 'profile':true } ``` Alternatively, you can use auxiliary objects to build your search query. For details, see the documentation on [**SearchRequest**](SearchRequest.md) It responds with an object with: - an array with hits (matched documents) found - if the query is timed out - time of execution - if profiling is enabled, an additional array with profiling information attached ``` { 'took':10, 'timed_out':false, 'hits': { 'total':2, 'hits': [ {'_id':'1','_score':1,'_source':{'gid':11}}, {'_id':'2','_score':1,'_source':{'gid':12}} ] } } ``` For more information about the match query syntax and additional parameters that can be added to request and response, please check: https://manual.manticoresearch.com/Searching/Full_text_matching/Basic_usage#HTTP-JSON. # noqa: E501
189+
The method expects an object with the following mandatory properties: * the name of the index to search * the match query object Here is an example search request: ``` { 'index':'movies', 'query': { 'bool': { 'must':[{'query_string':' movie'}] } }, 'script_fields': { 'myexpr': { 'script':{'inline':'IF(rating>8,1,0)' } }, 'sort': [ {'myexpr':'desc'}, {'_score':'desc'} ], 'profile':true } ``` Alternatively, you can use auxiliary objects to build your search query. For details, see the documentation on [**SearchRequest**](SearchRequest.md) The method returns an object with the following properties: - took: the time taken to execute the search query. - timed_out: a boolean indicating whether the query timed out. - hits: an object with the following properties: - total: the total number of hits found. - hits: an array of hit objects, where each hit object represents a matched document. Each hit object has the following properties: - _id: the ID of the matched document. - _score: the score of the matched document. - _source: the source data of the matched document. In addition, if profiling is enabled, the response will include an additional array with profiling information attached. Here is an example search response: ``` { 'took':10, 'timed_out':false, 'hits': { 'total':2, 'hits': [ {'_id':'1','_score':1,'_source':{'gid':11}}, {'_id':'2','_score':1,'_source':{'gid':12}} ] } } ``` For more information about the match query syntax and additional parameters that can be added to request and response, please see the documentation [here](https://manual.manticoresearch.com/Searching/Full_text_matching/Basic_usage#HTTP-JSON). # noqa: E501
190190
This method makes a synchronous HTTP request by default. To make an
191191
asynchronous HTTP request, please pass async_req=True
192192
@@ -214,9 +214,9 @@ def search(self, search_request, **kwargs): # noqa: E501
214214
return self.search_with_http_info(search_request, **kwargs) # noqa: E501
215215

216216
def search_with_http_info(self, search_request, **kwargs): # noqa: E501
217-
"""Performs a search # noqa: E501
217+
"""Performs a search on an index # noqa: E501
218218
219-
Expects an object with mandatory properties: * the index name * the match query object Example : ``` { 'index':'movies', 'query': { 'bool': { 'must':[{'query_string':' movie'}] } }, 'script_fields': { 'myexpr': { 'script':{'inline':'IF(rating>8,1,0)' } }, 'sort': [ {'myexpr':'desc'}, {'_score':'desc'} ], 'profile':true } ``` Alternatively, you can use auxiliary objects to build your search query. For details, see the documentation on [**SearchRequest**](SearchRequest.md) It responds with an object with: - an array with hits (matched documents) found - if the query is timed out - time of execution - if profiling is enabled, an additional array with profiling information attached ``` { 'took':10, 'timed_out':false, 'hits': { 'total':2, 'hits': [ {'_id':'1','_score':1,'_source':{'gid':11}}, {'_id':'2','_score':1,'_source':{'gid':12}} ] } } ``` For more information about the match query syntax and additional parameters that can be added to request and response, please check: https://manual.manticoresearch.com/Searching/Full_text_matching/Basic_usage#HTTP-JSON. # noqa: E501
219+
The method expects an object with the following mandatory properties: * the name of the index to search * the match query object Here is an example search request: ``` { 'index':'movies', 'query': { 'bool': { 'must':[{'query_string':' movie'}] } }, 'script_fields': { 'myexpr': { 'script':{'inline':'IF(rating>8,1,0)' } }, 'sort': [ {'myexpr':'desc'}, {'_score':'desc'} ], 'profile':true } ``` Alternatively, you can use auxiliary objects to build your search query. For details, see the documentation on [**SearchRequest**](SearchRequest.md) The method returns an object with the following properties: - took: the time taken to execute the search query. - timed_out: a boolean indicating whether the query timed out. - hits: an object with the following properties: - total: the total number of hits found. - hits: an array of hit objects, where each hit object represents a matched document. Each hit object has the following properties: - _id: the ID of the matched document. - _score: the score of the matched document. - _source: the source data of the matched document. In addition, if profiling is enabled, the response will include an additional array with profiling information attached. Here is an example search response: ``` { 'took':10, 'timed_out':false, 'hits': { 'total':2, 'hits': [ {'_id':'1','_score':1,'_source':{'gid':11}}, {'_id':'2','_score':1,'_source':{'gid':12}} ] } } ``` For more information about the match query syntax and additional parameters that can be added to request and response, please see the documentation [here](https://manual.manticoresearch.com/Searching/Full_text_matching/Basic_usage#HTTP-JSON). # noqa: E501
220220
This method makes a synchronous HTTP request by default. To make an
221221
asynchronous HTTP request, please pass async_req=True
222222

manticoresearch/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ def to_debug_report(self):
371371
return "Python SDK Debug Report:\n"\
372372
"OS: {env}\n"\
373373
"Python Version: {pyversion}\n"\
374-
"Version of the API: 1.0.0\n"\
374+
"Version of the API: 3.3.0\n"\
375375
"SDK Package Version: 3.3.0".\
376376
format(env=sys.platform, pyversion=sys.version)
377377

manticoresearch/model/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"""
55
Manticore Search Client
66
7-
Low-level client for Manticore Search. # noqa: E501
7+
Сlient for Manticore Search. # noqa: E501
88
9-
The version of the OpenAPI document: 1.0.0
9+
The version of the OpenAPI document: 3.3.0
1010
1111
Generated by: https://openapi-generator.tech
1212
"""

manticoresearch/model_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"""
22
Manticore Search Client
33
4-
Low-level client for Manticore Search. # noqa: E501
4+
Сlient for Manticore Search. # noqa: E501
55
6-
The version of the OpenAPI document: 1.0.0
6+
The version of the OpenAPI document: 3.3.0
77
88
Generated by: https://openapi-generator.tech
99
"""

0 commit comments

Comments
 (0)