Index search by original and split title (#5589)

* Index search by original and split title

* better normalization of title/author names for indexing

* replace println with warn

* fix test
This commit is contained in:
aecsocket
2026-03-20 04:01:19 +00:00
committed by GitHub
parent 00e81adbbd
commit 3c5bd0756d
3 changed files with 56 additions and 12 deletions
@@ -105,18 +105,25 @@ impl Default for RequestConfig {
}
fn default_query_by() -> Vec<String> {
["indexed_title", "slug", "summary", "indexed_author"]
.into_iter()
.map(str::to_string)
.collect()
[
"name",
"indexed_name",
"slug",
"author",
"indexed_author",
"summary",
]
.into_iter()
.map(str::to_string)
.collect()
}
fn default_query_by_weights() -> Vec<u8> {
vec![15, 5, 2, 1]
vec![15, 15, 10, 3, 3, 1]
}
fn default_prefix() -> Vec<bool> {
vec![true, true, true, true]
vec![true, true, true, true, true, true]
}
const fn default_prioritize_exact_match() -> bool {
@@ -491,7 +498,7 @@ impl Typesense {
let mut fields = vec![
json!({"name": "summary", "type": "string", "facet": false}),
json!({"name": "slug", "type": "string", "facet": false}),
json!({"name": "indexed_title", "type": "string", "facet": false, "stem": true}),
json!({"name": "indexed_name", "type": "string", "facet": false, "stem": true}),
json!({"name": "indexed_author", "type": "string", "facet": false}),
json!({"name": "log_downloads", "type": "float", "sort": true}),
json!({"name": "follows", "type": "int32", "facet": true, "sort": true}),