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

Update VectorSearch Core Operations: Add rescore option for vector queries #517

Open
jmazanec15 opened this issue Apr 17, 2024 · 1 comment

Comments

@jmazanec15
Copy link
Member

Description

For some of our vector search cases, we use quantization to reduce the amount of memory that the index will consume during search. This comes with the tradeoff that recall will be worse because the quantization is lossy. One strategy to improve recall is to "rescore" the top results from the vector search with scores that originate from the full precision vectors. For example, the query would look like this:

GET my-knn-index-1/_search
{
 	"size": 4,
	"query": {
	    "knn": {
	        "field_name": {
	            "vector": [...],
	            "k": 100
	        }
	    }
	},
    "rescore": {
	    "window_size": 100,
	    "query": {
	        "rescore_query": {
	            "script_score": {
	                "query": {
	                    "match_all": {}
	                },
	                "script": {
	                    "lang": "knn",
	                    "source": "knn_score",
	                    "params": {
	                        "field": "field_name",
	                        "query_value": [],
	                        "space_type": "l2"
	                    }
	                }
	            }
	        }
	    }
	}
}

I would like to add this option to the existing vector search queries in a configurable fashion.

@IanHoang
Copy link
Collaborator

IanHoang commented Apr 18, 2024

Similar to the previous issue opened (#516) and since this is more tailored to vectorsearch, please create this issue in the OSB workloads repository.

To enhance existing vector search queries, this can be done adding custom param sources workload.py.

Closing this issue as the suggested changes does not relate to core OSB repository code.

Reopened as these would apply to already built-in OSB core operations that were added a while back.

@IanHoang IanHoang reopened this Apr 18, 2024
@IanHoang IanHoang changed the title Add rescore option for vector queries Update VectorSearch Core Operations: Add rescore option for vector queries Apr 18, 2024
@gkamat gkamat removed the untriaged label Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants