Skip to content

Commit c3e7141

Browse files
committed
feat(v30): add synonym sets api
1 parent 6b0fdc8 commit c3e7141

File tree

1 file changed

+192
-0
lines changed

1 file changed

+192
-0
lines changed

openapi.yml

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,110 @@ paths:
713713
schema:
714714
$ref: "#/components/schemas/ApiResponse"
715715

716+
/synonym_sets:
717+
get:
718+
tags:
719+
- synonyms
720+
summary: List all synonym sets
721+
description: Retrieve all synonym sets
722+
operationId: retrieveSynonymSets
723+
responses:
724+
"200":
725+
description: List of all synonym sets
726+
content:
727+
application/json:
728+
schema:
729+
type: array
730+
items:
731+
$ref: "#/components/schemas/SynonymSetSchema"
732+
733+
/synonym_sets/{synonymSetName}:
734+
get:
735+
tags:
736+
- synonyms
737+
summary: Retrieve a synonym set
738+
description: Retrieve a specific synonym set by its name
739+
operationId: retrieveSynonymSet
740+
parameters:
741+
- name: synonymSetName
742+
in: path
743+
description: The name of the synonym set to retrieve
744+
required: true
745+
schema:
746+
type: string
747+
responses:
748+
"200":
749+
description: Synonym set fetched
750+
content:
751+
application/json:
752+
schema:
753+
$ref: "#/components/schemas/SynonymSetRetrieveSchema"
754+
"404":
755+
description: Synonym set not found
756+
content:
757+
application/json:
758+
schema:
759+
$ref: "#/components/schemas/ApiResponse"
760+
put:
761+
tags:
762+
- synonyms
763+
summary: Create or update a synonym set
764+
description: Create or update a synonym set with the given name
765+
operationId: upsertSynonymSet
766+
parameters:
767+
- name: synonymSetName
768+
in: path
769+
description: The name of the synonym set to create/update
770+
required: true
771+
schema:
772+
type: string
773+
requestBody:
774+
description: The synonym set to be created/updated
775+
content:
776+
application/json:
777+
schema:
778+
$ref: "#/components/schemas/SynonymSetCreateSchema"
779+
required: true
780+
responses:
781+
"200":
782+
description: Synonym set successfully created/updated
783+
content:
784+
application/json:
785+
schema:
786+
$ref: "#/components/schemas/SynonymSetSchema"
787+
"400":
788+
description: Bad request, see error message for details
789+
content:
790+
application/json:
791+
schema:
792+
$ref: "#/components/schemas/ApiResponse"
793+
delete:
794+
tags:
795+
- synonyms
796+
summary: Delete a synonym set
797+
description: Delete a specific synonym set by its name
798+
operationId: deleteSynonymSet
799+
parameters:
800+
- name: synonymSetName
801+
in: path
802+
description: The name of the synonym set to delete
803+
required: true
804+
schema:
805+
type: string
806+
responses:
807+
"200":
808+
description: Synonym set successfully deleted
809+
content:
810+
application/json:
811+
schema:
812+
$ref: "#/components/schemas/SynonymSetDeleteSchema"
813+
"404":
814+
description: Synonym set not found
815+
content:
816+
application/json:
817+
schema:
818+
$ref: "#/components/schemas/ApiResponse"
819+
716820
/collections/{collectionName}/documents/export:
717821
get:
718822
tags:
@@ -2079,6 +2183,12 @@ components:
20792183
minLength: 1
20802184
maxLength: 1
20812185
default: []
2186+
synonym_sets:
2187+
type: array
2188+
description: List of synonym set names to associate with this collection
2189+
items:
2190+
type: string
2191+
example: "synonym_set_1"
20822192
enable_nested_fields:
20832193
type: boolean
20842194
description:
@@ -2123,6 +2233,12 @@ components:
21232233
facet: true
21242234
items:
21252235
$ref: "#/components/schemas/Field"
2236+
synonym_sets:
2237+
type: array
2238+
description: List of synonym set names to associate with this collection
2239+
items:
2240+
type: string
2241+
example: "synonym_set_1"
21262242
metadata:
21272243
type: object
21282244
description: >
@@ -2997,6 +3113,11 @@ components:
29973113
a snippet of relevant portion. Default: 30
29983114
type: integer
29993115

3116+
synonym_sets:
3117+
type: string
3118+
description: List of synonym set names to associate with this search query
3119+
example: "synonym_set_1,synonym_set_2"
3120+
30003121
drop_tokens_threshold:
30013122
description: >
30023123
If the number of results found for a specific query is less than
@@ -4061,6 +4182,77 @@ components:
40614182
type: string
40624183
description: ID of the deleted NL search model
40634184

4185+
SynonymItemSchema:
4186+
type: object
4187+
required:
4188+
- id
4189+
- synonyms
4190+
properties:
4191+
id:
4192+
type: string
4193+
description: Unique identifier for the synonym item
4194+
synonyms:
4195+
type: array
4196+
description: Array of words that should be considered as synonyms
4197+
items:
4198+
type: string
4199+
root:
4200+
type: string
4201+
description: For 1-way synonyms, indicates the root word that words in the synonyms parameter map to
4202+
locale:
4203+
type: string
4204+
description: Locale for the synonym, leave blank to use the standard tokenizer
4205+
symbols_to_index:
4206+
type: array
4207+
description: By default, special characters are dropped from synonyms. Use this attribute to specify which special characters should be indexed as is
4208+
items:
4209+
type: string
4210+
4211+
SynonymSetCreateSchema:
4212+
type: object
4213+
required:
4214+
- items
4215+
properties:
4216+
items:
4217+
type: array
4218+
description: Array of synonym items
4219+
items:
4220+
$ref: "#/components/schemas/SynonymItemSchema"
4221+
4222+
SynonymSetSchema:
4223+
allOf:
4224+
- $ref: "#/components/schemas/SynonymSetCreateSchema"
4225+
- type: object
4226+
required:
4227+
- name
4228+
properties:
4229+
name:
4230+
type: string
4231+
description: Name of the synonym set
4232+
4233+
SynonymSetsRetrieveSchema:
4234+
type: object
4235+
required:
4236+
- synonym_sets
4237+
properties:
4238+
synonym_sets:
4239+
type: array
4240+
description: Array of synonym sets
4241+
items:
4242+
$ref: "#/components/schemas/SynonymSetSchema"
4243+
4244+
SynonymSetRetrieveSchema:
4245+
$ref: "#/components/schemas/SynonymSetCreateSchema"
4246+
4247+
SynonymSetDeleteSchema:
4248+
type: object
4249+
required:
4250+
- name
4251+
properties:
4252+
name:
4253+
type: string
4254+
description: Name of the deleted synonym set
4255+
40644256
securitySchemes:
40654257
api_key_header:
40664258
type: apiKey

0 commit comments

Comments
 (0)