Skip to content

Commit b96d32b

Browse files
committed
Updated Readme autogeneration
1 parent 098d80e commit b96d32b

File tree

2 files changed

+29
-24
lines changed

2 files changed

+29
-24
lines changed

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

README.md

100644100755
Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
# manticoresearch
22

3+
34
Low-level client for Manticore Search.
45

56

6-
For more information, please visit [https://manticoresearch.com/contact-us/](https://manticoresearch.com/contact-us/)
7+
❗ WARNING: this is a development version of the client. The latest release's readme is https://github.com/manticoresoftware/manticoresearch-java/tree/2.0.3
78

89

910
## Requirements
1011

1112
Building the API client library requires:
1213

13-
1. Java 1.7+
14+
1. Java 1.8+
1415
2. Maven/Gradle
1516

16-
Minimum Manticore Search version is > 4.0.2 with HTTP protocol enabled.
17+
Minimum Manticore Search version is 2.5.1 with HTTP protocol enabled.
1718

1819
## Installation
1920

@@ -23,7 +24,7 @@ Add this dependency to your project's POM:
2324
<dependency>
2425
<groupId>com.manticoresearch</groupId>
2526
<artifactId>manticoresearch</artifactId>
26-
<version>3.0.0</version>
27+
<version>3.1.0</version>
2728
</dependency>
2829
```
2930

@@ -32,7 +33,7 @@ Add this dependency to your project's POM:
3233
Add this dependency to your project's build file:
3334

3435
```groovy
35-
compile "com.manticoresearch:manticoresearch:3.0.0"
36+
compile "com.manticoresearch:manticoresearch:3.1.0"
3637
```
3738

3839
### Others
@@ -45,7 +46,7 @@ mvn clean package
4546

4647
Then manually install the following JARs:
4748

48-
- `target/manticoresearch-3.0.0.jar`
49+
- `target/manticoresearch-3.1.0.jar`
4950
- `target/lib/*.jar`
5051

5152
## Getting Started
@@ -54,30 +55,24 @@ Please follow the [installation](#installation) instruction and execute the foll
5455

5556
```java
5657

57-
import com.manticoresearch.client.ApiClient;
58-
import com.manticoresearch.client.ApiException;
59-
import com.manticoresearch.client.Configuration;
58+
import com.manticoresearch.client.*;
59+
import com.manticoresearch.client.auth.*;
6060
import com.manticoresearch.client.model.*;
6161
import com.manticoresearch.client.api.IndexApi;
62-
import com.manticoresearch.client.api.UtilsApi;
63-
import com.manticoresearch.client.api.SearchApi;
6462

65-
public class SearchApiExample {
63+
public class IndexApiExample {
6664

6765
public static void main(String[] args) {
68-
ApiClient client = Configuration.getDefaultApiClient();
69-
client.setBasePath("http://127.0.0.1:9308");
70-
SearchApi searchApi = new SearchApi(client);
66+
ApiClient defaultClient = Configuration.getDefaultApiClient();
67+
defaultClient.setBasePath("http://127.0.0.1:9308");
68+
69+
IndexApi apiInstance = new IndexApi(defaultClient);
70+
String body = ["'{\"insert\": {\"index\": \"test\", \"id\": 1, \"doc\": {\"title\": \"Title 1\"}}},\\n{\"insert\": {\"index\": \"test\", \"id\": 2, \"doc\": {\"title\": \"Title 2\"}}}'"]; // String |
7171
try {
72-
HashMap<String,Object> query = new HashMap<String,Object>();
73-
query.put("query_string","@title way* @content hey");
74-
searchRequest = new SearchRequest();
75-
searchRequest.setIndex("forum");
76-
searchRequest.setQuery(query);
77-
SearchResponse searchResponse = searchApi.search(searchRequest);
78-
System.out.println(searchResponse);
72+
BulkResponse result = apiInstance.bulk(body);
73+
System.out.println(result);
7974
} catch (ApiException e) {
80-
System.err.println("Exception when calling SearchApi#search");
75+
System.err.println("Exception when calling IndexApi#bulk");
8176
System.err.println("Status code: " + e.getCode());
8277
System.err.println("Reason: " + e.getResponseBody());
8378
System.err.println("Response headers: " + e.getResponseHeaders());
@@ -118,6 +113,7 @@ Class | Method | HTTP request | Description
118113
- [ErrorResponse](docs/ErrorResponse.md)
119114
- [InsertDocumentRequest](docs/InsertDocumentRequest.md)
120115
- [PercolateRequest](docs/PercolateRequest.md)
116+
- [PercolateRequestQuery](docs/PercolateRequestQuery.md)
121117
- [SearchRequest](docs/SearchRequest.md)
122118
- [SearchResponse](docs/SearchResponse.md)
123119
- [SearchResponseHits](docs/SearchResponseHits.md)
@@ -126,6 +122,15 @@ Class | Method | HTTP request | Description
126122
- [UpdateResponse](docs/UpdateResponse.md)
127123

128124

125+
## Documentation for Authorization
126+
127+
All endpoints do not require authorization.
128+
Authentication schemes defined for the API:
129+
130+
## Recommendation
131+
132+
It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
133+
129134
## Author
130135

131136

0 commit comments

Comments
 (0)