Skip to content

Commit 9f299ed

Browse files
committed
feat(synonyms): add deprecation logging and lsp info on old synonyms
1 parent 7546bec commit 9f299ed

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

src/main/java/org/typesense/api/Collection.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,31 @@ public Document documents(String documentId) {
6666
return retVal;
6767
}
6868

69+
/**
70+
* @deprecated This method is deprecated and will be removed in a future version.
71+
* Use {@link Client#synonymSets()} instead for the new synonym sets API.
72+
*
73+
* Note: The old synonyms API is only available on Typesense v29.0 and below.
74+
* For Typesense v30.0 and above, use the new synonym sets API.
75+
*/
76+
@Deprecated
6977
public Synonyms synonyms() {
78+
System.err.println("DEPRECATED: Using deprecated synonyms API. This API is only available on Typesense v29.0 and below. " +
79+
"For Typesense v30.0 and above, use the new synonym sets API via Client.synonymSets().");
7080
return this.synonyms;
7181
}
7282

83+
/**
84+
* @deprecated This method is deprecated and will be removed in a future version.
85+
* Use {@link Client#synonymSet(String)} instead for the new synonym sets API.
86+
*
87+
* Note: The old synonyms API is only available on Typesense v29.0 and below.
88+
* For Typesense v30.0 and above, use the new synonym sets API.
89+
*/
90+
@Deprecated
7391
public Synonym synonyms(String synonymId) {
92+
System.err.println("DEPRECATED: Using deprecated synonyms API. This API is only available on Typesense v29.0 and below. " +
93+
"For Typesense v30.0 and above, use the new synonym sets API via Client.synonymSet(String).");
7494
Synonym retVal;
7595

7696
if (!this.individualSynonyms.containsKey(synonymId)) {

src/main/java/org/typesense/api/Synonym.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
import org.typesense.api.utils.URLEncoding;
44
import org.typesense.model.SearchSynonym;
55

6+
/**
7+
* @deprecated This class is deprecated and will be removed in a future version.
8+
* Use {@link SynonymSet} instead for the new synonym sets API.
9+
*
10+
* Note: The old synonyms API is only available on Typesense v29.0 and below.
11+
* For Typesense v30.0 and above, use the new synonym sets API.
12+
*/
13+
@Deprecated
14+
615
public class Synonym {
716

817
private String collectionName;

src/main/java/org/typesense/api/Synonyms.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55
import org.typesense.model.SearchSynonymSchema;
66
import org.typesense.model.SearchSynonymsResponse;
77

8+
/**
9+
* @deprecated This class is deprecated and will be removed in a future version.
10+
* Use {@link SynonymSets} instead for the new synonym sets API.
11+
*
12+
* Note: The old synonyms API is only available on Typesense v29.0 and below.
13+
* For Typesense v30.0 and above, use the new synonym sets API.
14+
*/
15+
@Deprecated
16+
817
public class Synonyms {
918

1019
private String collectionName;

0 commit comments

Comments
 (0)