Skip to content

Commit d874a41

Browse files
authored
Merge branch 'main' into improve-eslint-prettier-tsconfig
2 parents fe762dd + 177947d commit d874a41

17 files changed

+566
-28
lines changed

.code-samples.meilisearch.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,12 @@ update_non_separator_tokens_1: |-
630630
client.index('books').updateNonSeparatorTokens(['@', '#'])
631631
reset_non_separator_tokens_1: |-
632632
client.index('books').resetNonSeparatorTokens()
633+
get_proximity_precision_settings_1: |-
634+
client.index('books').getProximityPrecision()
635+
update_proximity_precision_settings_1: |-
636+
client.index('books').updateProximityPrecision('byAttribute')
637+
reset_proximity_precision_settings_1: |-
638+
client.index('books').resetProximityPrecision()
633639
search_parameter_guide_facet_stats_1: |-
634640
client.index('movie_ratings').search('Batman', { facets: ['genres', 'rating'] })
635641
geosearch_guide_filter_settings_1: |-

.github/workflows/meilisearch-prototype-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
- '7700:7700'
4343
strategy:
4444
matrix:
45-
node: ['14', '16', '18']
45+
node: ['18', '20']
4646
name: integration-tests (Node.js ${{ matrix.node }})
4747
steps:
4848
- uses: actions/checkout@v4

.github/workflows/pre-release-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- '7700:7700'
4040
strategy:
4141
matrix:
42-
node: ['14', '16', '18']
42+
node: ['18', '20']
4343
name: integration-tests (Node.js ${{ matrix.node }})
4444
steps:
4545
- uses: actions/checkout@v4

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
- uses: actions/checkout@v4
1111
- uses: actions/setup-node@v4
1212
with:
13-
node-version: 16
13+
node-version: 20
1414
registry-url: https://registry.npmjs.org/
1515
cache: 'yarn'
1616
- name: Check release validity

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
strategy:
3535
fail-fast: false
3636
matrix:
37-
node: ['14', '16', '18']
37+
node: ['18', '20']
3838
name: integration-tests (Node.js ${{ matrix.node }})
3939
steps:
4040
- uses: actions/checkout@v4
@@ -69,7 +69,7 @@ jobs:
6969
- name: Setup node
7070
uses: actions/setup-node@v4
7171
with:
72-
node-version: 16
72+
node-version: 20
7373
cache: 'yarn'
7474
- name: Install dependencies
7575
run: yarn --dev
@@ -87,7 +87,7 @@ jobs:
8787
- name: Setup node
8888
uses: actions/setup-node@v4
8989
with:
90-
node-version: 16
90+
node-version: 20
9191
cache: 'yarn'
9292
- name: Install dependencies
9393
run: yarn --dev

README.md

Lines changed: 51 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -903,64 +903,106 @@ client.index('myIndex').resetTypoTolerance(): Promise<EnqueuedTask>
903903

904904
### Separator tokens <!-- omit in toc -->
905905

906-
#### Get separator tokens
906+
#### [Get separator tokens](https://www.meilisearch.com/docs/reference/api/settings#get-separator-tokens)
907907

908908
```ts
909909
client.index('myIndex').getSeparatorTokens(): Promise<SeparatorTokens>
910910
```
911911

912-
#### Update separator tokens
912+
#### [Update separator tokens](https://www.meilisearch.com/docs/reference/api/settings#update-separator-tokens)
913913

914914
```ts
915915
client.index('myIndex').updateSeparatorTokens(separatorTokens: SeparatorTokens | null): Promise<EnqueuedTask>
916916
```
917917

918-
#### Reset separator tokens
918+
#### [Reset separator tokens](https://www.meilisearch.com/docs/reference/api/settings#reset-separator-tokens)
919919

920920
```ts
921921
client.index('myIndex').resetSeparatorTokens(): Promise<EnqueuedTask>
922922
```
923923

924924
### Non Separator tokens <!-- omit in toc -->
925925

926-
#### Get non separator tokens
926+
#### [Get non separator tokens](https://www.meilisearch.com/docs/reference/api/settings#get-non-separator-tokens)
927927

928928
```ts
929929
client.index('myIndex').getNonSeparatorTokens(): Promise<NonSeparatorTokens>
930930
```
931931

932-
#### Update non separator tokens
932+
#### [Update non separator tokens](https://www.meilisearch.com/docs/reference/api/settings#update-non-separator-tokens)
933933

934934
```ts
935935
client.index('myIndex').updateNonSeparatorTokens(nonSeparatorTokens: NonSeparatorTokens | null): Promise<EnqueuedTask>
936936
```
937937

938-
#### Reset non separator tokens
938+
#### [Reset non separator tokens](https://www.meilisearch.com/docs/reference/api/settings#reset-non-separator-tokens)
939939

940940
```ts
941941
client.index('myIndex').resetNonSeparatorTokens(): Promise<EnqueuedTask>
942942
```
943943

944944
### Dictionary <!-- omit in toc -->
945945

946-
#### Get dictionary
946+
#### [Get dictionary](https://www.meilisearch.com/docs/reference/api/settings#get-dictionary)
947947

948948
```ts
949949
client.index('myIndex').getDictionary(): Promise<Dictionary>
950950
```
951951

952-
#### Update dictionary
952+
#### [Update dictionary](https://www.meilisearch.com/docs/reference/api/settings#update-dictionary)
953953

954954
```ts
955955
client.index('myIndex').updateDictionary(dictionary: Dictionary | null): Promise<EnqueuedTask>
956956
```
957957

958-
#### Reset dictionary
958+
#### [Reset dictionary](https://www.meilisearch.com/docs/reference/api/settings#reset-dictionary)
959959

960960
```ts
961961
client.index('myIndex').resetDictionary(): Promise<EnqueuedTask>
962962
```
963963

964+
### Proximity Precision <!-- omit in toc -->
965+
966+
#### [Get proximity precision](https://www.meilisearch.com/docs/reference/api/settings#get-proximity-precision)
967+
968+
```ts
969+
client.index('myIndex').getProximityPrecision(): Promise<ProximityPrecision>
970+
```
971+
972+
#### [Update proximity precision](https://www.meilisearch.com/docs/reference/api/settings#update-proximity-precision)
973+
974+
```ts
975+
client.index('myIndex').updateProximityPrecision(proximityPrecision: ProximityPrecision): Promise<EnqueuedTask>
976+
```
977+
978+
#### [Reset proximity precision](https://www.meilisearch.com/docs/reference/api/settings#reset-proximity-precision)
979+
980+
```ts
981+
client.index('myIndex').resetProximityPrecision(): Promise<EnqueuedTask>
982+
```
983+
984+
### Embedders <!-- omit in toc -->
985+
986+
⚠️ This feature is experimental. Activate the `vectorStore` experimental feature to use it](https://www.meilisearch.com/docs/reference/api/experimental_features#configure-experimental-features)
987+
988+
#### [Get embedders](https://www.meilisearch.com/docs/reference/api/settings#get-embedders)
989+
990+
```ts
991+
client.index('myIndex').getEmbedders(): Promise<Embedders>
992+
```
993+
994+
#### [Update embedders](https://www.meilisearch.com/docs/reference/api/settings#update-embedders)
995+
996+
```ts
997+
client.index('myIndex').updateEmbedders(embedders: Embedders): Promise<EnqueuedTask>
998+
```
999+
1000+
#### [Reset embedders](https://www.meilisearch.com/docs/reference/api/settings#reset-embedders)
1001+
1002+
```ts
1003+
client.index('myIndex').resetEmbedders(): Promise<EnqueuedTask>
1004+
```
1005+
9641006
### Keys <!-- omit in toc -->
9651007

9661008
#### [Get keys](https://www.meilisearch.com/docs/reference/api/keys#get-all-keys)

bors.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
status = [
22
'style-check',
33
'types-check',
4-
'integration-tests (Node.js 14)',
5-
'integration-tests (Node.js 16)',
64
'integration-tests (Node.js 18)',
5+
'integration-tests (Node.js 20)',
76
]
87
# 1 hour timeout
98
timeout-sec = 3600

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "meilisearch",
3-
"version": "0.36.0",
3+
"version": "0.37.0",
44
"description": "The Meilisearch JS client for Node.js and the browser.",
55
"keywords": [
66
"meilisearch",

src/indexes.ts

Lines changed: 88 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ import {
5050
SeparatorTokens,
5151
NonSeparatorTokens,
5252
Dictionary,
53+
ProximityPrecision,
54+
Embedders,
5355
} from './types'
5456
import { removeUndefinedFromObject } from './utils'
5557
import { HttpRequests } from './http-requests'
@@ -1222,7 +1224,7 @@ class Index<T extends Record<string, any> = Record<string, any>> {
12221224
}
12231225

12241226
/**
1225-
* Update the the dictionary settings. Overwrite the old settings.
1227+
* Update the dictionary settings. Overwrite the old settings.
12261228
*
12271229
* @param dictionary - Array that contains the new dictionary settings.
12281230
* @returns Promise containing an EnqueuedTask or null
@@ -1247,6 +1249,91 @@ class Index<T extends Record<string, any> = Record<string, any>> {
12471249

12481250
return task
12491251
}
1252+
1253+
///
1254+
/// PROXIMITY PRECISION
1255+
///
1256+
1257+
/**
1258+
* Get the proximity precision settings of a Meilisearch index.
1259+
*
1260+
* @returns Promise containing the proximity precision settings
1261+
*/
1262+
async getProximityPrecision(): Promise<ProximityPrecision> {
1263+
const url = `indexes/${this.uid}/settings/proximity-precision`
1264+
return await this.httpRequest.get<ProximityPrecision>(url)
1265+
}
1266+
1267+
/**
1268+
* Update the proximity precision settings. Overwrite the old settings.
1269+
*
1270+
* @param proximityPrecision - String that contains the new proximity
1271+
* precision settings.
1272+
* @returns Promise containing an EnqueuedTask or null
1273+
*/
1274+
async updateProximityPrecision(
1275+
proximityPrecision: ProximityPrecision
1276+
): Promise<EnqueuedTask> {
1277+
const url = `indexes/${this.uid}/settings/proximity-precision`
1278+
const task = await this.httpRequest.put(url, proximityPrecision)
1279+
1280+
return new EnqueuedTask(task)
1281+
}
1282+
1283+
/**
1284+
* Reset the proximity precision settings to its default value
1285+
*
1286+
* @returns Promise containing an EnqueuedTask
1287+
*/
1288+
async resetProximityPrecision(): Promise<EnqueuedTask> {
1289+
const url = `indexes/${this.uid}/settings/proximity-precision`
1290+
const task = await this.httpRequest.delete<EnqueuedTask>(url)
1291+
1292+
task.enqueuedAt = new Date(task.enqueuedAt)
1293+
1294+
return task
1295+
}
1296+
1297+
///
1298+
/// EMBEDDERS
1299+
///
1300+
1301+
/**
1302+
* Get the embedders settings of a Meilisearch index.
1303+
*
1304+
* @returns Promise containing the embedders settings
1305+
*/
1306+
async getEmbedders(): Promise<Embedders> {
1307+
const url = `indexes/${this.uid}/settings/embedders`
1308+
return await this.httpRequest.get<Embedders>(url)
1309+
}
1310+
1311+
/**
1312+
* Update the embedders settings. Overwrite the old settings.
1313+
*
1314+
* @param embedders - Object that contains the new embedders settings.
1315+
* @returns Promise containing an EnqueuedTask or null
1316+
*/
1317+
async updateEmbedders(embedders: Embedders): Promise<EnqueuedTask> {
1318+
const url = `indexes/${this.uid}/settings/embedders`
1319+
const task = await this.httpRequest.patch(url, embedders)
1320+
1321+
return new EnqueuedTask(task)
1322+
}
1323+
1324+
/**
1325+
* Reset the embedders settings to its default value
1326+
*
1327+
* @returns Promise containing an EnqueuedTask
1328+
*/
1329+
async resetEmbedders(): Promise<EnqueuedTask> {
1330+
const url = `indexes/${this.uid}/settings/embedders`
1331+
const task = await this.httpRequest.delete<EnqueuedTask>(url)
1332+
1333+
task.enqueuedAt = new Date(task.enqueuedAt)
1334+
1335+
return task
1336+
}
12501337
}
12511338

12521339
export { Index }

src/package-version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const PACKAGE_VERSION = '0.36.0'
1+
export const PACKAGE_VERSION = '0.37.0'

0 commit comments

Comments
 (0)