Skip to content

Commit 656fbf1

Browse files
committed
v28: add stemming dictionary endpoints and schemas
- add `/stemming/dictionaries` endpoints for listing and retrieving - add `/stemming/dictionaries/import` endpoint for importing dictionaries - add `StemmingDictionary` schema and related field properties - add `stem_dictionary` property to `Field` schema
1 parent d383893 commit 656fbf1

File tree

1 file changed

+127
-0
lines changed

1 file changed

+127
-0
lines changed

openapi.yml

+127
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ tags:
6161
externalDocs:
6262
description: Find out more
6363
url: https://typesense.org/docs/28.0/api/synonyms.html
64+
- name: stemming
65+
description: Manage stemming dictionaries
66+
externalDocs:
67+
description: Find out more
68+
url: https://typesense.org/docs/28.0/api/stemming.html
6469
paths:
6570
/collections:
6671
get:
@@ -1761,6 +1766,97 @@ paths:
17611766
application/json:
17621767
schema:
17631768
$ref: '#/components/schemas/ApiResponse'
1769+
/stemming/dictionaries:
1770+
get:
1771+
tags:
1772+
- stemming
1773+
summary: List all stemming dictionaries
1774+
description: Retrieve a list of all available stemming dictionaries.
1775+
operationId: listStemmingDictionaries
1776+
responses:
1777+
'200':
1778+
description: List of all dictionaries
1779+
content:
1780+
application/json:
1781+
schema:
1782+
type: object
1783+
properties:
1784+
dictionaries:
1785+
type: array
1786+
items:
1787+
type: string
1788+
example: ["irregular-plurals", "company-terms"]
1789+
1790+
/stemming/dictionaries/{dictionaryId}:
1791+
get:
1792+
tags:
1793+
- stemming
1794+
summary: Retrieve a stemming dictionary
1795+
description: Fetch details of a specific stemming dictionary.
1796+
operationId: getStemmingDictionary
1797+
parameters:
1798+
- name: dictionaryId
1799+
in: path
1800+
description: The ID of the dictionary to retrieve
1801+
required: true
1802+
schema:
1803+
type: string
1804+
example: irregular-plurals
1805+
responses:
1806+
'200':
1807+
description: Stemming dictionary details
1808+
content:
1809+
application/json:
1810+
schema:
1811+
$ref: "#/components/schemas/StemmingDictionary"
1812+
'404':
1813+
description: Dictionary not found
1814+
content:
1815+
application/json:
1816+
schema:
1817+
$ref: "#/components/schemas/ApiResponse"
1818+
1819+
/stemming/dictionaries/import:
1820+
post:
1821+
tags:
1822+
- stemming
1823+
summary: Import a stemming dictionary
1824+
description: Upload a JSONL file containing word mappings to create or update a stemming dictionary.
1825+
operationId: importStemmingDictionary
1826+
parameters:
1827+
- name: id
1828+
in: query
1829+
description: The ID to assign to the dictionary
1830+
required: true
1831+
schema:
1832+
type: string
1833+
example: irregular-plurals
1834+
requestBody:
1835+
description: The JSONL file containing word mappings
1836+
required: true
1837+
content:
1838+
application/json:
1839+
schema:
1840+
type: string
1841+
example: |
1842+
{"word": "people", "root": "person"}
1843+
{"word": "children", "root": "child"}
1844+
responses:
1845+
'200':
1846+
description: Dictionary successfully imported
1847+
content:
1848+
application/octet-stream:
1849+
schema:
1850+
type: string
1851+
example: >
1852+
{"word": "people", "root": "person"}
1853+
{"word": "children", "root": "child"}
1854+
'400':
1855+
description: Bad request, see error message for details
1856+
content:
1857+
application/json:
1858+
schema:
1859+
$ref: "#/components/schemas/ApiResponse"
17641860
components:
17651861
schemas:
17661862
CollectionSchema:
@@ -1925,6 +2021,10 @@ components:
19252021
type: boolean
19262022
description: >
19272023
Values are stemmed before indexing in-memory. Default: false.
2024+
stem_dictionary:
2025+
type: string
2026+
description: Name of the stemming dictionary to use for this field
2027+
example: irregular-plurals
19282028
token_separators:
19292029
type: array
19302030
description: >
@@ -3654,6 +3754,33 @@ components:
36543754
id:
36553755
type: string
36563756
description: An explicit id for the model, otherwise the API will return a response with an auto-generated conversation model id.
3757+
StemmingDictionary:
3758+
type: object
3759+
required:
3760+
- id
3761+
- words
3762+
properties:
3763+
id:
3764+
type: string
3765+
description: Unique identifier for the dictionary
3766+
example: irregular-plurals
3767+
words:
3768+
type: array
3769+
description: List of word mappings in the dictionary
3770+
items:
3771+
type: object
3772+
required:
3773+
- word
3774+
- root
3775+
properties:
3776+
word:
3777+
type: string
3778+
description: The word form to be stemmed
3779+
example: people
3780+
root:
3781+
type: string
3782+
description: The root form of the word
3783+
example: person
36573784
securitySchemes:
36583785
api_key_header:
36593786
type: apiKey

0 commit comments

Comments
 (0)