Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support concatenated field as default search field #5331

Merged
merged 3 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions quickwit/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion quickwit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ quickwit-serve = { path = "quickwit-serve" }
quickwit-storage = { path = "quickwit-storage" }
quickwit-telemetry = { path = "quickwit-telemetry" }

tantivy = { git = "https://github.com/quickwit-oss/tantivy/", rev = "c71ec80", default-features = false, features = [
tantivy = { git = "https://github.com/quickwit-oss/tantivy/", rev = "9f81d59", default-features = false, features = [
"lz4-compression",
"mmap",
"quickwit",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1735,6 +1735,28 @@ mod tests {
.contains("concatenate type must have at least one sub-field"));
}

#[test]
fn test_concatenate_field_in_default_field() {
serde_json::from_str::<DefaultDocMapper>(
r#"{
"default_search_fields": ["concat"],
"field_mappings": [
{
"name": "some_text",
"type": "text"
},
{
"name": "concat",
"type": "concatenate",
"concatenate_fields": ["some_text"]
}
],
"mode": "strict"
}"#,
)
.unwrap();
}

#[test]
fn test_concatenate_field_in_mapping() {
test_doc_from_json_test_aux(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ expected:
message:
$expect: "\"unknown default search field `regular_field`\" in val"
---
# should fail because default search field targets the root
# of a json field.
# should fail because default search field targets a sub field of a
# non-json field
method: POST
endpoint: indexes/
json:
Expand All @@ -26,15 +26,15 @@ json:
doc_mapping:
mode: dynamic
field_mappings:
- name: inner_json
type: json
- name: text
type: text
search_settings:
default_search_fields:
- inner_json
- text.inner
status_code: 400
expected:
message:
$expect: "\"unknown default search field `inner_json`\" in val"
$expect: "\"unknown default search field `text.inner`\" in val"
---
# should fail because dynamic field is not indexed.
method: POST
Expand Down
Loading