Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): opensearch version 2.19
Describe the issue: I have deployed opensearch-neural-sparse-encoding-v2-distill for neural sparse search query. I have indexed around 3000 documents.. its ecommerce catalog. i am using name field and pushing brand+category+product_name+features combined string in name field. I am searching particular text like green tea, its giving me all 3000 documents. although I have only 70-80 relevant products. what could be the issue?
Configuration: POST /_plugins/_ml/models/_register?deploy=true
{
"name": "amazon/neural-sparse/opensearch-neural-sparse-encoding-v2-distill",
"version": "1.0.0",
"model_format": "TORCH_SCRIPT"
}
PUT /_ingest/pipeline/nlp-ingest-pipeline-sparse
{
"description": "A sparse encoding ingest pipeline",
"processors": [
{
"sparse_encoding": {
"model_id": "<model_id>",
"prune_type": "max_ratio",
"prune_ratio": 0.2,
"field_map": {
"sparse_fulltext": "name_sparse"
}
}
}
]
}
POST items/_search
{
"_source": {
"excludes": ["name_v"]
},
"query": {
"script_score": {
"query": {
"bool": {
"should": [
{
"neural_sparse": {
"name_sparse": {
"query_text": "Green Tea",
"model_id": "model_id"
}
}
},
{
"match": {
"name": {
"query": "Green tea",
"operator": "and"
}
}
}
],
"minimum_should_match": 1
}
},
"script": {
"source": "_score"
}
}
}
}
Relevant Logs or Screenshots:
{
"took": 60,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 2407,
"relation": "eq"
},
"max_score": 31.46042,
"hits": []
}
}