Skip to content

Commit a4e7b28

Browse files
committed
Merge remote-tracking branch 'origin/main' into typotolerance
2 parents dabe471 + d63bec5 commit a4e7b28

35 files changed

+3649
-1496
lines changed

.code-samples.meilisearch.yaml

Lines changed: 1 addition & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -152,17 +152,6 @@ update_settings_1: |-
152152
synonyms.insert(String::from("wolverine"), vec!["xmen", "logan"]);
153153
synonyms.insert(String::from("logan"), vec!["wolverine"]);
154154
155-
let min_word_size_for_typos = MinWordSizeForTypos {
156-
one_typo: Some(4),
157-
two_typos; Some(12)
158-
}
159-
let typo_tolerance = TypoToleranceSettings {
160-
enabled: Some(true),
161-
disable_on_attributes: Some(vec!["title".to_string()]),
162-
disable_on_words: Some(vec![])
163-
min_word_size_for_typos: Some(min_word_size_for_typos),
164-
};
165-
166155
let settings = Settings::new()
167156
.with_ranking_rules([
168157
"words",
@@ -195,8 +184,7 @@ update_settings_1: |-
195184
"title",
196185
"release_date"
197186
])
198-
.with_synonyms(synonyms)
199-
.with_typo_tolerance(typo_tolerance);
187+
.with_synonyms(synonyms);
200188
201189
let task: TaskInfo = client
202190
.index("movies")
@@ -252,48 +240,6 @@ reset_pagination_settings_1: |-
252240
.reset_pagination()
253241
.await
254242
.unwrap();
255-
getting_started_typo_tolerance: |-
256-
let min_word_size_for_typos = MinWordSizeForTypos {
257-
one_typo: Some(5),
258-
two_typos: Some(4)
259-
}
260-
let typo_tolerance = TypoToleranceSettings {
261-
enabled: Some(true),
262-
disable_on_attributes: Some(vec![]),
263-
disable_on_words: Some(vec!["title".to_string()]),
264-
min_word_size_for_typos: Some(min_word_size_for_typos),
265-
};
266-
267-
let task: TaskInfo = client
268-
.index("movies")
269-
.set_typo_tolerance(&typo_tolerance)
270-
.await
271-
.unwrap();
272-
get_typo_tolerance_1: |-
273-
let typo_tolerance: TypoToleranceSettings = client
274-
.index("books")
275-
.get_typo_tolerance()
276-
.await
277-
.unwrap();
278-
update_typo_tolerance_1: |-
279-
let typo_tolerance = TypoToleranceSettings {
280-
enabled: Some(false),
281-
disable_on_attributes: Some(vec![]),
282-
disable_on_words: Some(vec![]),
283-
min_word_size_for_typos: Some(MinWordSizeForTypos::default()),
284-
};
285-
286-
let task: TaskInfo = client
287-
.index("books")
288-
.set_typo_tolerance(&typo_tolerance)
289-
.await
290-
.unwrap();
291-
reset_typo_tolerance_1: |-
292-
let task: TaskInfo = client
293-
.index("books")
294-
.reset_typo_tolerance()
295-
.await
296-
.unwrap();
297243
get_stop_words_1: |-
298244
let stop_words: Vec<String> = client
299245
.index("movies")
@@ -777,90 +723,6 @@ settings_guide_faceting_1: |-
777723
.set_settings(&settings)
778724
.await
779725
.unwrap();
780-
settings_guide_typo_tolerance_1: |-
781-
let min_word_size_for_typos = MinWordSizeForTypos {
782-
one_typo: Some(5),
783-
two_typos: Some(12)
784-
}
785-
let typo_tolerance = TypoToleranceSettings {
786-
enabled: Some(true),
787-
disable_on_attributes: Some(vec![]),
788-
disable_on_words: Some(vec!["title".to_string()]),
789-
min_word_size_for_typos: Some(min_word_size_for_typos),
790-
};
791-
792-
let settings = Settings::new()
793-
.with_typo_tolerance(&typo_tolerance);
794-
795-
let task: TaskInfo = client
796-
.index("movies")
797-
.set_settings(&settings)
798-
.await
799-
.unwrap();
800-
typo_tolerance_guide_1: |-
801-
let typo_tolerance = TypoToleranceSettings {
802-
enabled: Some(false),
803-
disable_on_attributes: Some(vec![]),
804-
disable_on_words: Some(vec![]),
805-
min_word_size_for_typos: Some(MinWordSizeForTypos::default()),
806-
};
807-
808-
let task: TaskInfo = client
809-
.index("movies")
810-
.set_typo_tolerance(&typo_tolerance)
811-
.await
812-
.unwrap();
813-
typo_tolerance_guide_2: |-
814-
let min_word_size_for_typos = MinWordSizeForTypos {
815-
one_typo: Some(5),
816-
two_typos: Some(12)
817-
}
818-
let typo_tolerance = TypoToleranceSettings {
819-
enabled: Some(true),
820-
disable_on_attributes: Some(vec!["title".to_string()]),
821-
disable_on_words: Some(vec![]),
822-
min_word_size_for_typos: Some(min_word_size_for_typos),
823-
};
824-
825-
let task: TaskInfo = client
826-
.index("movies")
827-
.set_typo_tolerance(&typo_tolerance)
828-
.await
829-
.unwrap();
830-
typo_tolerance_guide_3: |-
831-
let min_word_size_for_typos = MinWordSizeForTypos {
832-
one_typo: Some(5),
833-
two_typos: Some(12)
834-
}
835-
let typo_tolerance = TypoToleranceSettings {
836-
enabled: Some(true),
837-
disable_on_attributes: Some(vec![]),
838-
disable_on_words: Some(vec!["shrek".to_string()]),
839-
min_word_size_for_typos: Some(min_word_size_for_typos),
840-
};
841-
842-
let task: TaskInfo = client
843-
.index("movies")
844-
.set_typo_tolerance(&typo_tolerance)
845-
.await
846-
.unwrap();
847-
typo_tolerance_guide_4: |-
848-
let min_word_size_for_typos = MinWordSizeForTypos {
849-
one_typo: Some(4),
850-
two_typos: Some(12)
851-
};
852-
let typo_tolerance = TypoToleranceSettings {
853-
enabled: Some(true),
854-
disable_on_attributes: Some(vec![]),
855-
disable_on_words: Some(vec!["title".to_string()]),
856-
min_word_size_for_typos: Some(min_word_size_for_typos),
857-
};
858-
859-
let task: TaskInfo = client
860-
.index("movies")
861-
.set_typo_tolerance(&typo_tolerance)
862-
.await
863-
.unwrap();
864726
add_movies_json_1: |-
865727
use meilisearch_sdk::{
866728
indexes::*,

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
version: 2
22
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
labels:
8+
- 'skip-changelog'
9+
- 'dependencies'
10+
rebase-strategy: disabled
11+
312
- package-ecosystem: cargo
413
directory: "/"
514
schedule:

.github/scripts/check-release.sh

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,37 @@
11
#!/bin/sh
22

33
# Checking if current tag matches the package version
4-
current_tag=$(echo $GITHUB_REF | tr -d 'refs/tags/v')
5-
major=$(echo $current_tag | cut -d '.' -f1 )
6-
minor=$(echo $current_tag | cut -d '.' -f2 )
7-
cropped_current_tag="$major.$minor"
4+
current_tag=$(echo $GITHUB_REF | cut -d '/' -f 3 | sed -r 's/^v//')
5+
major=$(echo $current_tag | cut -d '.' -f1)
6+
minor=$(echo $current_tag | cut -d '.' -f2)
7+
88
file1='Cargo.toml'
99
file2='README.tpl'
1010
file3='.code-samples.meilisearch.yaml'
1111
file4='README.md'
12+
file5='./meilisearch-index-setting-macro/Cargo.toml'
1213

1314
file_tag1=$(grep '^version = ' $file1 | cut -d '=' -f 2 | tr -d '"' | tr -d ' ')
15+
file_tag_1_1=$(grep '{ path = "meilisearch-index-setting-macro", version =' $file1 | grep -Eo '[0-9]+.[0-9]+.[0-9]+')
1416
file_tag2=$(grep 'meilisearch-sdk = ' $file2 | cut -d '=' -f 2 | tr -d '"' | tr -d ' ')
1517
file_tag3=$(grep 'meilisearch-sdk = ' $file3 | cut -d '=' -f 2 | tr -d '"' | tr -d ' ')
1618
file_tag4=$(grep 'meilisearch-sdk = ' $file4 | cut -d '=' -f 2 | tr -d '"' | tr -d ' ')
17-
if [ "$current_tag" != "$file_tag1" ] || [ "$current_tag" != "$file_tag2" ] || [ "$cropped_current_tag" != "$file_tag3" ] || [ "$current_tag" != "$file_tag4" ]; then
19+
file_tag5=$(grep '^version = ' $file5 | grep -Eo '[0-9]+.[0-9]+.[0-9]+')
20+
21+
if [ "$current_tag" != "$file_tag1" ] ||
22+
[ "$current_tag" != "$file_tag_1_1" ] ||
23+
[ "$current_tag" != "$file_tag2" ] ||
24+
[ "$current_tag" != "$file_tag3" ] ||
25+
[ "$current_tag" != "$file_tag4" ] ||
26+
[ "$current_tag" != "$file_tag5" ] \
27+
; then
1828
echo "Error: the current tag does not match the version in package file(s)."
1929
echo "$file1: found $file_tag1 - expected $current_tag"
30+
echo "$file1: found $file_tag_1_1 - expected $current_tag"
2031
echo "$file2: found $file_tag2 - expected $current_tag"
21-
echo "$file3: found $file_tag3 - expected $cropped_current_tag"
32+
echo "$file3: found $file_tag3 - expected $current_tag"
2233
echo "$file4: found $file_tag4 - expected $current_tag"
34+
echo "$file5: found $file_tag5 - expected $current_tag"
2335
exit 1
2436
fi
2537

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
name: integration-tests-against-rc
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v3
2020
- name: Build
2121
run: cargo build --verbose
2222
- name: Get the latest Meilisearch RC

.github/workflows/publish.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,23 @@ jobs:
99
name: Rust project
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v3
1313
- uses: hecrj/setup-rust-action@master
1414
with:
1515
rust-version: stable
1616
- name: Check release validity
1717
run: sh .github/scripts/check-release.sh
18-
- name: Build
18+
- name: Build meilisearch crate
1919
run: cargo build --release
20+
- name: Build meilisearch crate
21+
run: |-
22+
cd meilisearch-index-setting-macro
23+
cargo build --release
2024
- name: Login
2125
run: cargo login ${{ secrets.CRATES_TOKEN }}
22-
- name: Publish to crates.io
26+
- name: Publish meilisearch-index-setting-macro crate to crates.io
27+
run: |-
28+
cd meilisearch-index-setting-macro
29+
cargo publish
30+
- name: Publish meilisearch crate to crates.io
2331
run: cargo publish

.github/workflows/tests.yml

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -20,52 +20,52 @@ jobs:
2020
runs-on: ubuntu-latest
2121
name: integration-tests
2222
steps:
23-
- uses: actions/checkout@v2
24-
- name: Build
25-
run: cargo build --verbose
26-
- name: Meilisearch (latest version) setup with Docker
27-
run: docker run -d -p 7700:7700 getmeili/meilisearch:latest meilisearch --no-analytics --master-key=masterKey
28-
- name: Run tests
29-
run: cargo test --verbose
30-
- name: Cargo check
31-
uses: actions-rs/cargo@v1
32-
with:
33-
command: check
34-
args: --workspace --all-targets --all
23+
- uses: actions/checkout@v3
24+
- name: Build
25+
run: cargo build --verbose
26+
- name: Meilisearch (latest version) setup with Docker
27+
run: docker run -d -p 7700:7700 getmeili/meilisearch:latest meilisearch --no-analytics --master-key=masterKey
28+
- name: Run tests
29+
run: cargo test --verbose
30+
- name: Cargo check
31+
uses: actions-rs/cargo@v1
32+
with:
33+
command: check
34+
args: --workspace --all-targets --all
3535

3636
linter:
3737
name: clippy-check
3838
runs-on: ubuntu-latest
3939
steps:
40-
- uses: actions/checkout@v2
41-
- name: Install clippy
42-
run: rustup component add clippy
43-
- name: Run linter (clippy)
44-
# Will fail when encountering warnings
45-
run: cargo clippy -- -D warnings
40+
- uses: actions/checkout@v3
41+
- name: Install clippy
42+
run: rustup component add clippy
43+
- name: Run linter (clippy)
44+
# Will fail when encountering warnings
45+
run: cargo clippy -- -D warnings
4646

4747
formatter:
4848
name: rust-format
4949
runs-on: ubuntu-latest
5050
steps:
51-
- uses: actions/checkout@v2
52-
- name: Run formatter
53-
run: cargo fmt
51+
- uses: actions/checkout@v3
52+
- name: Run formatter
53+
run: cargo fmt --all -- --check
5454

5555
readme_check:
5656
name: readme-check
5757
runs-on: ubuntu-latest
5858
steps:
59-
- uses: actions/checkout@v2
60-
- name: Check the README.md file is up-to-date
61-
run: sh scripts/check-readme.sh
59+
- uses: actions/checkout@v3
60+
- name: Check the README.md file is up-to-date
61+
run: sh scripts/check-readme.sh
6262

6363
wasm_build:
6464
name: wasm-build
6565
runs-on: ubuntu-latest
6666
steps:
67-
- uses: actions/checkout@v2
68-
- name: Build
69-
run: |
70-
rustup target add wasm32-unknown-unknown
71-
cargo check -p web_app --target wasm32-unknown-unknown
67+
- uses: actions/checkout@v3
68+
- name: Build
69+
run: |
70+
rustup target add wasm32-unknown-unknown
71+
cargo check -p web_app --target wasm32-unknown-unknown

0 commit comments

Comments
 (0)