Skip to content

Commit 1c70bd3

Browse files
committed
Merge main branch
2 parents 4f6d041 + 04244fa commit 1c70bd3

30 files changed

+703
-853
lines changed

.code-samples.meilisearch.yaml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,11 +267,24 @@ search_parameter_guide_crop_1: |-
267267
SearchRequest searchRequest =
268268
new SearchRequest("shifu")
269269
.setAttributesToCrop(new String[] {"overview"})
270-
.setCropLength(10);
270+
.setCropLength(5);
271+
client.index("movies").search(searchRequest);
272+
search_parameter_guide_crop_marker_1: |-
273+
SearchRequest searchRequest =
274+
new SearchRequest("shifu")
275+
.setAttributesToCrop(new String[] {"overview"})
276+
.setCropMarker("[…]");
271277
client.index("movies").search(searchRequest);
272278
search_parameter_guide_highlight_1: |-
273279
SearchRequest searchRequest =
274-
new SearchRequest("and").setAttributesToHighlight(new String[] {"overview"});
280+
new SearchRequest("winter feast").setAttributesToHighlight(new String[] {"overview"});
281+
client.index("movies").search(searchRequest);
282+
search_parameter_guide_highlight_tag_1: |-
283+
SearchRequest searchRequest =
284+
new SearchRequest("winter feast")
285+
.setAttributesToHighlight(new String[] {"overview"})
286+
.setHighlightPreTag("<span class=\"highlight\">")
287+
.setHighlightPostTag("</span>");
275288
client.index("movies").search(searchRequest);
276289
search_parameter_guide_matches_1: |-
277290
SearchRequest searchRequest = new SearchRequest("winter feast").setMatches(true);
@@ -384,15 +397,15 @@ getting_started_add_documents_md: |-
384397
<dependency>
385398
<groupId>com.meilisearch.sdk</groupId>
386399
<artifactId>meilisearch-java</artifactId>
387-
<version>0.7.0</version>
400+
<version>0.7.2</version>
388401
<type>pom</type>
389402
</dependency>
390403
```
391404
392405
**Gradle**
393406
Add the following line to the `dependencies` section of your `build.gradle`:
394407
```groovy
395-
implementation 'com.meilisearch.sdk:meilisearch-java:0.7.0'
408+
implementation 'com.meilisearch.sdk:meilisearch-java:0.7.2'
396409
```
397410
398411
```java

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Add the following code to the `<dependencies>` section of your project:
5353
<dependency>
5454
<groupId>com.meilisearch.sdk</groupId>
5555
<artifactId>meilisearch-java</artifactId>
56-
<version>0.7.0</version>
56+
<version>0.7.2</version>
5757
<type>pom</type>
5858
</dependency>
5959
```
@@ -63,7 +63,7 @@ Add the following code to the `<dependencies>` section of your project:
6363
Add the following line to the `dependencies` section of your `build.gradle`:
6464

6565
```groovy
66-
implementation 'com.meilisearch.sdk:meilisearch-java:0.7.0'
66+
implementation 'com.meilisearch.sdk:meilisearch-java:0.7.2'
6767
```
6868

6969
### Run Meilisearch <!-- omit in toc -->

build.gradle

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ plugins {
1212
id 'maven-publish'
1313
id 'signing'
1414
id 'io.codearte.nexus-staging' version '0.30.0'
15-
id "com.diffplug.spotless" version "6.3.0"
15+
id "com.diffplug.spotless" version "6.5.2"
1616
}
1717

1818
group = 'com.meilisearch.sdk'
1919
archivesBaseName = 'meilisearch-java'
20-
version = '0.7.1'
20+
version = '0.7.2'
2121

2222
java {
2323
sourceCompatibility = JavaVersion.VERSION_1_8
@@ -37,7 +37,7 @@ dependencies {
3737
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
3838
implementation 'com.google.guava:guava:31.1-jre'
3939
implementation 'com.google.code.gson:gson:2.9.0'
40-
implementation 'org.json:json:20211205'
40+
implementation 'org.json:json:20220320'
4141
// https://mvnrepository.com/artifact/org.apache.httpcomponents.client5/httpclient5
4242
compileOnly group: 'org.apache.httpcomponents.client5', name: 'httpclient5', version: '5.1.3'
4343
compileOnly 'com.squareup.okhttp3:okhttp:4.9.3'
@@ -46,22 +46,22 @@ dependencies {
4646
testImplementation(platform('org.junit:junit-bom:5.8.2'))
4747
testImplementation('org.junit.jupiter:junit-jupiter:5.8.2')
4848
// https://mvnrepository.com/artifact/org.mockito/mockito-core
49-
testImplementation 'org.mockito:mockito-core:4.4.0'
49+
testImplementation 'org.mockito:mockito-core:4.5.1'
5050
testImplementation 'org.hamcrest:hamcrest:2.2'
5151

5252
// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind
53-
compileOnly group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.13.2'
53+
compileOnly group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.13.2.2'
5454
compileOnly group: 'jakarta.json.bind', name: 'jakarta.json.bind-api', version: '2.0.0'
5555
testImplementation group: 'org.eclipse', name: 'yasson', version: '2.0.4'
5656

5757
// Lombok
58-
compileOnly 'org.projectlombok:lombok:1.18.22'
58+
compileOnly 'org.projectlombok:lombok:1.18.24'
5959
annotationProcessor 'org.projectlombok:lombok:1.18.22'
60-
testCompileOnly 'org.projectlombok:lombok:1.18.16'
60+
testCompileOnly 'org.projectlombok:lombok:1.18.24'
6161
testAnnotationProcessor 'org.projectlombok:lombok:1.18.16'
6262

6363
// Jwt
64-
implementation 'com.auth0:java-jwt:3.18.3'
64+
implementation 'com.auth0:java-jwt:3.19.2'
6565
}
6666

6767
task buildJar(type: Jar) {

src/main/java/com/meilisearch/sdk/Config.java

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package com.meilisearch.sdk;
22

3+
import lombok.Getter;
4+
35
/** Meilisearch configuration */
6+
@Getter
47
public class Config {
58
String hostUrl;
69
String apiKey;
@@ -25,24 +28,6 @@ public Config(String hostUrl, String apiKey) {
2528
this.apiKey = apiKey;
2629
}
2730

28-
/**
29-
* Method for returning the hostUrl
30-
*
31-
* @return host URL string of the Meilisearch instance
32-
*/
33-
public String getHostUrl() {
34-
return hostUrl;
35-
}
36-
37-
/**
38-
* Method for returning the apiKey
39-
*
40-
* @return API key String
41-
*/
42-
public String getApiKey() {
43-
return apiKey;
44-
}
45-
4631
/**
4732
* Method for returning the concatenated Bearer header with apiKey
4833
*
Lines changed: 4 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
package com.meilisearch.sdk;
22

33
import java.util.Map;
4+
import lombok.Getter;
5+
import lombok.Setter;
46

7+
@Getter
8+
@Setter
59
public class Details {
610

711
public Details() {}
@@ -18,109 +22,4 @@ public Details() {}
1822
protected String[] stopWords;
1923
protected Map<String, String[]> synonyms;
2024
protected String distinctAttribute;
21-
protected TypoTolerance typoTolerance;
22-
23-
public int getReceivedDocuments() {
24-
return receivedDocuments;
25-
}
26-
27-
public void setReceivedDocuments(int receivedDocuments) {
28-
this.receivedDocuments = receivedDocuments;
29-
}
30-
31-
public int getIndexedDocuments() {
32-
return indexedDocuments;
33-
}
34-
35-
public void setIndexedDocuments(int indexedDocuments) {
36-
this.indexedDocuments = indexedDocuments;
37-
}
38-
39-
public int getDeletedDocuments() {
40-
return deletedDocuments;
41-
}
42-
43-
public void setDeletedDocuments(int deletedDocuments) {
44-
this.deletedDocuments = deletedDocuments;
45-
}
46-
47-
public String getPrimaryKey() {
48-
return primaryKey;
49-
}
50-
51-
public void setPrimaryKey(String primaryKey) {
52-
this.primaryKey = primaryKey;
53-
}
54-
55-
public String[] getRankingRules() {
56-
return rankingRules;
57-
}
58-
59-
public void setRankingRules(String[] rankingRules) {
60-
this.rankingRules = rankingRules;
61-
}
62-
63-
public String[] getSearchableAttributes() {
64-
return searchableAttributes;
65-
}
66-
67-
public void setSearchableAttributes(String[] searchableAttributes) {
68-
this.searchableAttributes = searchableAttributes;
69-
}
70-
71-
public String[] getDisplayedAttributes() {
72-
return displayedAttributes;
73-
}
74-
75-
public void setDisplayedAttributes(String[] displayedAttributes) {
76-
this.displayedAttributes = displayedAttributes;
77-
}
78-
79-
public String[] getFilterableAttributes() {
80-
return filterableAttributes;
81-
}
82-
83-
public void setFilterableAttributes(String[] filterableAttributes) {
84-
this.filterableAttributes = filterableAttributes;
85-
}
86-
87-
public String[] getSortableAttributes() {
88-
return sortableAttributes;
89-
}
90-
91-
public void setSortableAttributes(String[] sortableAttributes) {
92-
this.sortableAttributes = sortableAttributes;
93-
}
94-
95-
public String[] getStopWords() {
96-
return stopWords;
97-
}
98-
99-
public void setStopWords(String[] stopWords) {
100-
this.stopWords = stopWords;
101-
}
102-
103-
public Map<String, String[]> getSynonyms() {
104-
return synonyms;
105-
}
106-
107-
public void setSynonyms(Map<String, String[]> synonyms) {
108-
this.synonyms = synonyms;
109-
}
110-
111-
public String getDistinctAttribute() {
112-
return distinctAttribute;
113-
}
114-
115-
public void setDistinctAttribute(String distinctAttribute) {
116-
this.distinctAttribute = distinctAttribute;
117-
}
118-
119-
public TypoTolerance getTypoTolerance() {
120-
return typoTolerance;
121-
}
122-
123-
public void setTypoTolerance(TypoTolerance typoTolerance) {
124-
this.typoTolerance = typoTolerance;
125-
}
12625
}

src/main/java/com/meilisearch/sdk/Dump.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
import lombok.ToString;
55

66
/** Meilisearch dump */
7+
@Getter
78
public class Dump {
8-
@Getter private String status;
9-
@Getter private String uid;
10-
@Getter @ToString.Exclude private String startedAt;
11-
@Getter @ToString.Exclude private String finishedAt;
9+
private String status;
10+
private String uid;
11+
@ToString.Exclude private String startedAt;
12+
@ToString.Exclude private String finishedAt;
1213
}

src/main/java/com/meilisearch/sdk/GenericServiceTemplate.java

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
import com.meilisearch.sdk.http.request.HttpRequest;
1010
import com.meilisearch.sdk.http.response.HttpResponse;
1111
import com.meilisearch.sdk.json.JsonHandler;
12+
import lombok.Getter;
1213

14+
@Getter
1315
public class GenericServiceTemplate implements ServiceTemplate {
1416
private final AbstractHttpClient client;
1517
private final JsonHandler processor;
@@ -27,24 +29,6 @@ public GenericServiceTemplate(
2729
this.requestFactory = requestFactory;
2830
}
2931

30-
/** {@inheritDoc} */
31-
@Override
32-
public AbstractHttpClient getClient() {
33-
return client;
34-
}
35-
36-
/** {@inheritDoc} */
37-
@Override
38-
public JsonHandler getProcessor() {
39-
return processor;
40-
}
41-
42-
/** {@inheritDoc} */
43-
@Override
44-
public RequestFactory getRequestFactory() {
45-
return requestFactory;
46-
}
47-
4832
/** {@inheritDoc} */
4933
@Override
5034
@SuppressWarnings("unchecked")

0 commit comments

Comments
 (0)