ensure the synonyms are updated when the tokenizer settings are changed

This commit is contained in:
ManyTheFish 2023-07-26 09:33:42 +02:00
parent d57026cd96
commit b0c1a9504a
7 changed files with 52 additions and 26 deletions

View file

@ -232,7 +232,7 @@ async fn advanced_synergies() {
let (_response, _code) = index
.update_settings(json!({
"dictionary": ["J.R.R.", "J. R. R.", "J.K.", "J. K."],
"dictionary": ["J.R.R.", "J. R. R."],
"synonyms": {
"J.R.R.": ["jrr", "J. R. R."],
"J. R. R.": ["jrr", "J.R.R."],
@ -347,6 +347,14 @@ async fn advanced_synergies() {
})
.await;
// Only update dictionary, the synonyms should be recomputed.
let (_response, _code) = index
.update_settings(json!({
"dictionary": ["J.R.R.", "J. R. R.", "J.K.", "J. K."],
}))
.await;
index.wait_task(2).await;
index
.search(json!({"q": "jk", "attributesToHighlight": ["content"]}), |response, code| {
snapshot!(code, @"200 OK");