Skip to content

Commit 516def4

Browse files
committed
Updated docs and Readme
1 parent 3ecd8fc commit 516def4

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ configuration = manticoresearch.Configuration(
6464

6565
# Enter a context with an instance of the API client
6666
with manticoresearch.ApiClient(configuration) as api_client:
67-
# Create an instance of the API class
67+
# Create an instance of the IndexApi API class
6868
api_instance = manticoresearch.IndexApi(api_client)
6969
body = "["'{\"insert\": {\"index\": \"test\", \"id\": 1, \"doc\": {\"title\": \"Title 1\"}}},\\n{\"insert\": {\"index\": \"test\", \"id\": 2, \"doc\": {\"title\": \"Title 2\"}}}'"]" # str |
7070

@@ -75,6 +75,22 @@ with manticoresearch.ApiClient(configuration) as api_client:
7575
except ApiException as e:
7676
print("Exception when calling IndexApi->bulk: %s\n" % e)
7777

78+
79+
# Create an instance of the Search API class
80+
api_instance = manticoresearch.SearchApi(api_client)
81+
82+
# Create SearchRequest
83+
search_request = SearchRequest()
84+
search_request.index='test'
85+
search_request.fullltext_filter=QueryFilter('Title 1')
86+
87+
# example passing only required values which don't have defaults set
88+
try:
89+
# Perform a search
90+
api_response = api_instance.search(search_request)
91+
pprint(api_response)
92+
except manticoresearch.ApiException as e:
93+
print("Exception when calling SearchApi->search: %s\n" % e)
7894
```
7995

8096
# Documentation

docs/SearchApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,12 @@ with manticoresearch.ApiClient(configuration) as api_client:
104104
# Create an instance of the API class
105105
api_instance = search_api.SearchApi(api_client)
106106

107+
# Create SearchRequest
107108
search_request = SearchRequest()
108109
search_request.index='test'
109110
search_request.fullltext_filter=QueryFilter('find smth')
110111

111-
# or create SearchRequest in alternative way
112-
112+
# or create SearchRequest in an alternative way
113113
search_request = SearchRequest(
114114
index='test',
115115
query={'query_string': 'find smth'},

0 commit comments

Comments
 (0)