ucdavis / PolicyWonk

Chat with a UC Policy Expert
3 stars 1 forks source link

update elastic search function to use hybrid search and RRF #80

Open srkirkland opened 3 months ago

srkirkland commented 3 months ago

something like

{
    "knn": {
        "field": "vector",
        "filter": [],
        "k": 1,
        "num_candidates": 50,
        "query_vector": [1.0, ..., 0.0],
    },
    "query": {
        "bool": {
            "filter": [],
            "must": [{"match": {"text": {"query": "foo"}}}],
        }
    },
    "rank": {"rrf": {}},
}
srkirkland commented 3 months ago

https://www.elastic.co/search-labs/tutorials/search-tutorial/vector-search/hybrid-search