-
Notifications
You must be signed in to change notification settings - Fork 140
Expand file tree
/
Copy pathSimilarDocumentRequest.java
More file actions
48 lines (43 loc) · 1.71 KB
/
SimilarDocumentRequest.java
File metadata and controls
48 lines (43 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.meilisearch.sdk;
import lombok.*;
import lombok.experimental.Accessors;
import org.json.JSONObject;
@Builder
@AllArgsConstructor(access = AccessLevel.PACKAGE)
@Getter
@Setter
@Accessors(chain = true)
public class SimilarDocumentRequest {
private String id;
private String embedder;
private String[] attributesToRetrieve;
private Integer offset;
private Integer limit;
private String filter;
private Boolean showRankingScore;
private Boolean showRankingScoreDetails;
private Double rankingScoreThreshold;
private Boolean retrieveVectors;
/**
* Constructor for SimilarDocumentsRequest for building search request for similar documents
* with the default values: id null, embedder "default", attributesToRetrieve ["*"], offset 0,
* limit 20, filter null, showRankingScore false, showRankingScoreDetails false,
* rankingScoreThreshold null, retrieveVectors false
*/
public SimilarDocumentRequest() {}
@Override
public String toString() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("id", this.id);
jsonObject.put("embedder", this.embedder);
jsonObject.putOpt("attributesToRetrieve", this.attributesToRetrieve);
jsonObject.putOpt("offset", this.offset);
jsonObject.putOpt("limit", this.limit);
jsonObject.putOpt("filter", this.filter);
jsonObject.putOpt("showRankingScore", this.showRankingScore);
jsonObject.putOpt("showRankingScoreDetails", this.showRankingScoreDetails);
jsonObject.putOpt("rankingScoreThreshold", this.rankingScoreThreshold);
jsonObject.putOpt("retrieveVectors", this.retrieveVectors);
return jsonObject.toString();
}
}