Skip to content

Commit c355286

Browse files
committed
Fixed docs
1 parent 2bd5fba commit c355286

23 files changed

+228
-44
lines changed

.github/workflows/publish.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,3 @@ jobs:
2424
VERSION=`git log -1 --date=format:"%y%m%d%H" --format=%cd|head`
2525
echo "version $VERSION"
2626
sed -i -E "s/(VERSION = \")([0-9]\.[0-9]\.)(.*)(\")/\1\2$VERSION\4/1" setup.py
27-
- name: Publish
28-
run: |
29-
echo $PYPIRC > ~/.pypirc
30-
python -m pip install --user --upgrade wheel
31-
python -m pip install --user --upgrade twine
32-
python setup.py sdist bdist_wheel
33-
python -m twine upload dist/* -u __token__ -p $PYPI_TOKEN

.openapi-generator/FILES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ docs/SearchRequest.md
4040
docs/SearchResponse.md
4141
docs/SearchResponseHits.md
4242
docs/SourceRules.md
43+
docs/SqlResponse.md
4344
docs/SuccessResponse.md
4445
docs/UpdateDocumentRequest.md
4546
docs/UpdateResponse.md
@@ -89,6 +90,7 @@ manticoresearch/models/search_request.py
8990
manticoresearch/models/search_response.py
9091
manticoresearch/models/search_response_hits.py
9192
manticoresearch/models/source_rules.py
93+
manticoresearch/models/sql_response.py
9294
manticoresearch/models/success_response.py
9395
manticoresearch/models/update_document_request.py
9496
manticoresearch/models/update_response.py
@@ -136,6 +138,7 @@ test/test_search_request.py
136138
test/test_search_response.py
137139
test/test_search_response_hits.py
138140
test/test_source_rules.py
141+
test/test_sql_response.py
139142
test/test_success_response.py
140143
test/test_update_document_request.py
141144
test/test_update_response.py

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Сlient for Manticore Search.
44

55

6-
❗ WARNING: this is a development version of the client. The latest release's readme is https://github.com/manticoresoftware/manticoresearch-python/tree/4.0.0
6+
❗ WARNING: this is a development version of the client. The latest release's readme is https://github.com/manticoresoftware/manticoresearch-python/tree/6.0.0
77

88
## Requirements.
99

@@ -68,12 +68,18 @@ with manticoresearch.ApiClient(configuration) as api_client:
6868
# Create instances of API classes
6969
indexApi = manticoresearch.IndexApi(api_client)
7070
searchApi = manticoresearch.SearchApi(api_client)
71+
utilsApi = manticoresearch.UtilsApi(api_client)
7172

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

7884
newDoc = {"title" : "Pet Hair Remover Glove", "price": 7.99}
7985
insert_request = InsertDocumentRequest(index="products", doc=newDoc)
@@ -150,6 +156,7 @@ Class | Method | HTTP request | Description
150156
- [SearchResponse](docs/SearchResponse.md)
151157
- [SearchResponseHits](docs/SearchResponseHits.md)
152158
- [SourceRules](docs/SourceRules.md)
159+
- [SqlResponse](docs/SqlResponse.md)
153160
- [SuccessResponse](docs/SuccessResponse.md)
154161
- [UpdateDocumentRequest](docs/UpdateDocumentRequest.md)
155162
- [UpdateResponse](docs/UpdateResponse.md)

docs/BulkResponse.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Name | Type | Description | Notes
99
**items** | **List[object]** | List of results | [optional]
1010
**errors** | **bool** | Errors occurred during the bulk operation | [optional]
1111
**error** | **str** | Error message describing an error if such occurred | [optional]
12+
**current_line** | **int** | Number of the row returned in the response | [optional]
13+
**skipped_lines** | **int** | Number of rows skipped in the response | [optional]
1214

1315
## Example
1416

docs/IndexApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ with manticoresearch.ApiClient(configuration) as api_client:
250250
# Create an instance of the API class
251251
api_instance = manticoresearch.IndexApi(api_client)
252252
index = 'index_example' # str | Name of the percolate index
253-
id = 3.4 # float | Id of the document to replace
253+
id = 56 # int | Id of the document to replace
254254
replace_document_request = {"doc":{"price":20}} # ReplaceDocumentRequest |
255255

256256
try:
@@ -270,7 +270,7 @@ with manticoresearch.ApiClient(configuration) as api_client:
270270
Name | Type | Description | Notes
271271
------------- | ------------- | ------------- | -------------
272272
**index** | **str**| Name of the percolate index |
273-
**id** | **float**| Id of the document to replace |
273+
**id** | **int**| Id of the document to replace |
274274
**replace_document_request** | [**ReplaceDocumentRequest**](ReplaceDocumentRequest.md)| |
275275

276276
### Return type

docs/SearchApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Method | HTTP request | Description
1313
1414
Perform reverse search on a percolate index
1515

16-
Performs a percolate search. This method must be used only on percolate indexes. Expects two parameters: the index name and an object with array of documents to be tested. An example of the documents object: ``` { \"query\": { \"percolate\": { \"document\": { \"content\":\"sample content\" } } } } ``` Responds with an object with matched stored queries: ``` { 'timed_out':false, 'hits': { 'total':2, 'max_score':1, 'hits': [ { '_index':'idx_pq_1', '_type':'doc', '_id':'2', '_score':'1', '_source': { 'query': { 'match':{'title':'some'} } } }, { '_index':'idx_pq_1', '_type':'doc', '_id':'5', '_score':'1', '_source': { 'query': { 'ql':'some | none' } } } ] } } ```
16+
Performs a percolate search. <br><br> This method must be used only on percolate indexes. <br> Expects two parameters: the index name and an object with array of documents to be tested. <br> <br> An example of the documents object: <br> { <br> &nbsp;&nbsp;\"query\" {<br> &nbsp;&nbsp;&nbsp;&nbsp;\"percolate\": {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"document\": { <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"content\":\"sample content\" <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <br> &nbsp;&nbsp;&nbsp;&nbsp;} <br> &nbsp;&nbsp;} <br> } <br> <br> Responds with an object with matched stored queries: <br> { <br> &nbsp;&nbsp;'timed_out':false, <br> &nbsp;&nbsp;'hits': { <br> &nbsp;&nbsp;&nbsp;&nbsp;'total':2, <br> &nbsp;&nbsp;&nbsp;&nbsp;'max_score':1, <br> &nbsp;&nbsp;&nbsp;&nbsp;'hits': [ <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '_index':'idx_pq_1', <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '_type':'doc', <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '_id':'2', <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '_score':'1', <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '_source': { <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'query': { <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'match':{'title':'some'} <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }, <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '_index':'idx_pq_1', <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '_type':'doc', <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '_id':'5', <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '_score':'1', <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '_source': { <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'query': { <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'ql':'some | none' <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br> &nbsp;&nbsp;&nbsp;&nbsp; ] <br> &nbsp;&nbsp; } <br> } <br> ```
1717

1818
### Example
1919

@@ -85,7 +85,7 @@ No authorization required
8585
8686
Performs a search on an index
8787

88-
The method expects an object with the following mandatory properties: * the name of the index to search * the match query object 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).
88+
The method expects an object with the following mandatory properties: * the name of the index to search * the match query object 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. Also, if pagination is enabled, the response will include an additional 'scroll' property with a scroll token to use for pagination 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).
8989

9090
### Example
9191

docs/SearchResponse.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Name | Type | Description | Notes
1111
**aggregations** | **object** | Aggregated search results grouped by the specified criteria | [optional]
1212
**hits** | [**SearchResponseHits**](SearchResponseHits.md) | | [optional]
1313
**profile** | **object** | Profile information about the search execution, if profiling is enabled | [optional]
14+
**scroll** | **str** | Scroll token to be used fo pagination | [optional]
1415
**warning** | **object** | Warnings encountered during the search operation | [optional]
1516

1617
## Example

docs/SqlResponse.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# SqlResponse
2+
3+
List of responses from executed SQL queries
4+
5+
## Properties
6+
7+
Name | Type | Description | Notes
8+
------------ | ------------- | ------------- | -------------
9+
10+
## Example
11+
12+
```python
13+
from manticoresearch.models.sql_response import SqlResponse
14+
15+
# create an instance of SqlResponse from a JSON string
16+
sql_response_instance = SqlResponse.from_json(json)
17+
# print the JSON string representation of the object
18+
print(SqlResponse.to_json())
19+
20+
# convert the object into a dict
21+
sql_response_dict = sql_response_instance.to_dict()
22+
# create an instance of SqlResponse from a dict
23+
sql_response_from_dict = SqlResponse.from_dict(sql_response_dict)
24+
```
25+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
26+
27+

docs/SuccessResponse.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Response object indicating the success of an operation, such as inserting or upd
77
Name | Type | Description | Notes
88
------------ | ------------- | ------------- | -------------
99
**index** | **str** | Name of the document index | [optional]
10+
**table** | **str** | Name of the document table (alias of index) | [optional]
1011
**id** | **int** | ID of the document affected by the request operation | [optional]
1112
**created** | **bool** | Indicates whether the document was created as a result of the operation | [optional]
1213
**result** | **str** | Result of the operation, typically &#39;created&#39;, &#39;updated&#39;, or &#39;deleted&#39; | [optional]

docs/UtilsApi.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Method | HTTP request | Description
88

99

1010
# **sql**
11-
> List[object] sql(body, raw_response=raw_response)
11+
> SqlResponse sql(body, raw_response=raw_response)
1212
1313
Perform SQL requests
1414

@@ -19,6 +19,7 @@ Run a query in SQL format. Expects a query string passed through `body` paramete
1919

2020
```python
2121
import manticoresearch
22+
from manticoresearch.models.sql_response import SqlResponse
2223
from manticoresearch.rest import ApiException
2324
from pprint import pprint
2425

@@ -57,7 +58,7 @@ Name | Type | Description | Notes
5758

5859
### Return type
5960

60-
**List[object]**
61+
[**SqlResponse**](SqlResponse.md)
6162

6263
### Authorization
6364

0 commit comments

Comments
 (0)