Versions opensearch v2.19.2
Enabling profile: true in a hybrid search query (BM25 + vector search) causes the request to fail with an error, while the same query executes successfully and returns results when profiling is not enabled.
query:
POST products/_search
{
"size": 5,
"profile": true,
"search_pipeline": {
"phase_results_processors": [
{
"normalization-processor": {
"combination": {
"parameters": {
"weights": [
0.99,
0.01
]
},
"technique": "arithmetic_mean"
},
"normalization": {
"technique": "min_max"
}
}
}
]
},
"query": {
"hybrid": {
"queries": [
{
"function_score": {
"query": {
"match": {
"product_name": "iphone"
}
},
"boost": 1,
"functions": [
{
"weight": 1.2
}
],
"score_mode": "sum",
"boost_mode": "multiply"
}
},
{
"function_score": {
"query": {
"knn": {
"text_vector": {
"vector": [
0.11,
0.4,
-0.32,
0.77,
-0.55,
0.92,
-0.22,
0.45,
0.2,
-0.65,
0.89,
-0.13,
0.34,
0.57,
-0.46,
0.79,
0.15,
-0.21,
0.31,
-0.12,
0.28,
0.65,
-0.36,
0.44,
0.53,
-0.62,
0.7,
-0.18,
0.37,
0.47,
-0.73,
0.81,
0.14,
-0.38,
0.29,
0.6,
-0.48,
0.63,
-0.21,
0.55,
0.27,
-0.53,
0.67,
-0.3,
0.31,
0.64,
-0.4,
0.72,
0.18,
-0.27,
0.5,
0.62,
-0.54,
0.65,
-0.35,
0.51,
0.23,
-0.43,
0.73,
-0.26,
0.41,
0.56,
-0.37,
0.74,
0.16,
-0.32,
0.43,
0.66,
-0.51,
0.68,
-0.29,
0.49,
0.25,
-0.42,
0.76,
-0.28,
0.36,
0.61,
-0.39,
0.78,
0.19,
-0.3,
0.48,
0.63,
-0.52,
0.72,
-0.33,
0.54,
0.21,
-0.47,
0.79,
-0.25,
0.39,
0.59,
-0.41,
0.81
],
"k": 5
}
}
},
"boost": 1,
"functions": [
{
"weight": 1
}
],
"score_mode": "sum",
"boost_mode": "multiply"
}
}
]
}
}
}
result:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "scorers are null for all sub-queries in hybrid query"
}
],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "query",
"grouped": true,
"failed_shards": [
{
"shard": 0,
"index": "products",
"node": "MwuYt0TAQ8GrBvldHHuG6A",
"reason": {
"type": "illegal_argument_exception",
"reason": "scorers are null for all sub-queries in hybrid query"
}
}
],
"caused_by": {
"type": "illegal_argument_exception",
"reason": "scorers are null for all sub-queries in hybrid query",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "scorers are null for all sub-queries in hybrid query"
}
}
},
"status": 400
}
Steps to reproduce the issue:
# create index
PUT products
{
"settings": {
"index": {
"knn": true,
"number_of_replicas": 0
}
},
"mappings": {
"properties": {
"product_name": {
"type": "text"
},
"product_description": {
"type": "text"
},
"text_vector": {
"type": "knn_vector",
"dimension": 96
}
}
}
}
# insert a sample record
POST products/_doc/1
{
"product_name": "Apple iPhone 15",
"product_description": "The latest iPhone with A16 Bionic chip and advanced camera system.",
"text_vector": [
0.12,
0.45,
-0.33,
0.78,
-0.56,
0.91,
-0.23,
0.44,
0.19,
-0.67,
0.88,
-0.12,
0.35,
0.56,
-0.44,
0.77,
0.11,
-0.22,
0.33,
-0.11,
0.25,
0.66,
-0.39,
0.41,
0.52,
-0.63,
0.71,
-0.15,
0.38,
0.49,
-0.72,
0.83,
0.14,
-0.36,
0.27,
0.59,
-0.46,
0.62,
-0.19,
0.57,
0.22,
-0.54,
0.68,
-0.28,
0.33,
0.61,
-0.42,
0.74,
0.17,
-0.29,
0.48,
0.63,
-0.51,
0.69,
-0.32,
0.53,
0.21,
-0.47,
0.72,
-0.26,
0.39,
0.58,
-0.41,
0.75,
0.15,
-0.34,
0.46,
0.62,
-0.48,
0.67,
-0.31,
0.55,
0.23,
-0.49,
0.71,
-0.27,
0.36,
0.59,
-0.43,
0.76,
0.18,
-0.35,
0.47,
0.64,
-0.52,
0.7,
-0.33,
0.54,
0.2,
-0.46,
0.73,
-0.25,
0.37,
0.6,
-0.4,
0.78
]
}
Configuration:
Relevant Logs or Screenshots:
GET /_cluster/health
{
"cluster_name": "docker-cluster",
"status": "green",
"timed_out": false,
"number_of_nodes": 1,
"number_of_data_nodes": 1,
"discovered_master": true,
"discovered_cluster_manager": true,
"active_primary_shards": 6,
"active_shards": 6,
"relocating_shards": 0,
"initializing_shards": 0,
"unassigned_shards": 0,
"delayed_unassigned_shards": 0,
"number_of_pending_tasks": 0,
"number_of_in_flight_fetch": 0,
"task_max_waiting_in_queue_millis": 0,
"active_shards_percent_as_number": 100
}