diff --git a/tests/vespa_test_schema/schemas/document_passage.sd b/tests/vespa_test_schema/schemas/document_passage.sd index 29492a3..aeac5fb 100644 --- a/tests/vespa_test_schema/schemas/document_passage.sd +++ b/tests/vespa_test_schema/schemas/document_passage.sd @@ -134,6 +134,37 @@ schema document_passage { summary concepts {} } + document-summary search_summary_with_tokens { + summary family_name {} + summary family_description {} + summary family_import_id {} + summary family_slug {} + summary family_category {} + summary family_publication_ts {} + summary family_geography {} + summary family_geographies {} + summary family_source {} + summary document_import_id {} + summary document_slug {} + summary document_languages {} + summary document_content_type {} + summary document_cdn_object {} + summary document_source_url {} + summary corpus_import_id {} + summary corpus_type_name {} + summary metadata {} + summary text_block {} + summary text_block_id {} + summary text_block_type {} + summary text_block_page {} + summary text_block_coords {} + summary concepts {} + summary text_block_tokens { + source: text_block + tokens + } + } + rank-profile exact inherits default { function text_score() { expression: attribute(passage_weight) * fieldMatch(text_block) @@ -141,7 +172,7 @@ schema document_passage { first-phase { expression: text_score() } - match-features: text_score() + match-features: text_score() fieldMatch(text_block) } rank-profile hybrid_no_closeness inherits default { @@ -151,7 +182,7 @@ schema document_passage { first-phase { expression: text_score() } - match-features: text_score() + match-features: text_score() bm25(text_block) } rank-profile hybrid inherits default { @@ -164,6 +195,20 @@ schema document_passage { first-phase { expression: text_score() } - match-features: text_score() + match-features: text_score() bm25(text_block) closeness(text_embedding) + } + + rank-profile hybrid_custom_weight inherits default { + inputs { + query(query_embedding) tensor(x[768]) + query(bm25_weight) double + } + function text_score() { + expression: attribute(passage_weight) * (query(bm25_weight) * bm25(text_block) + closeness(text_embedding)) + } + first-phase { + expression: text_score() + } + match-features: text_score() bm25(text_block) closeness(text_embedding) } } diff --git a/tests/vespa_test_schema/schemas/family_document.sd b/tests/vespa_test_schema/schemas/family_document.sd index e62d6df..2aa6cf3 100644 --- a/tests/vespa_test_schema/schemas/family_document.sd +++ b/tests/vespa_test_schema/schemas/family_document.sd @@ -192,7 +192,7 @@ schema family_document { expression: attribute(name_weight) * bm25(family_name_index) } function description_score() { - expression: attribute(description_weight) * (bm25(family_description_index) + closeness(family_description_embedding)) + expression: attribute(description_weight) * bm25(family_description_index) } first-phase { expression: name_score() + description_score() @@ -200,6 +200,24 @@ schema family_document { match-features: name_score() description_score() } + rank-profile hybrid_custom_weight inherits default { + inputs { + query(query_embedding) tensor(x[768]) + query(bm25_weight) double + } + function name_score() { + expression: attribute(name_weight) * bm25(family_name_index) + } + function description_score() { + expression: attribute(description_weight) * bm25(family_description_index) + } + first-phase { + expression: name_score() + description_score() + } + match-features: name_score() description_score() + } + + document-summary search_summary { summary family_name {} summary family_description {} @@ -223,4 +241,39 @@ schema family_document { summary collection_title {} summary collection_summary {} } + + document-summary search_summary_with_tokens { + summary family_name {} + summary family_description {} + summary family_import_id {} + summary family_slug {} + summary family_category {} + summary family_publication_ts {} + summary family_geography {} + summary family_geographies {} + summary family_source {} + summary document_import_id {} + summary document_title {} + summary document_slug {} + summary document_languages {} + summary document_content_type {} + summary document_cdn_object {} + summary document_source_url {} + summary metadata {} + summary corpus_import_id {} + summary corpus_type_name {} + summary collection_title {} + summary collection_summary {} + summary family_name_index {} + summary family_name_index_tokens { + source: family_name_index + tokens + } + summary family_description_index {} + summary family_description_index_tokens { + source: family_description_index + tokens + } + from-disk + } }