Skip to content

Support the ability to dynamically send embedding field in first phase ranker #35735

@schandrasekhar

Description

@schandrasekhar

Is your feature request related to a problem? Please describe.
Provide the ability to dynamically send embedding vector field in first phase ranker. My first phase ranker function is defined as follows

schema product {
    
    document product {
        field vector_v1_0_0 type tensor<float>(x[10]) {
            indexing: summary | attribute | index
            attribute {
                distance-metric: dotproduct 
            }
        }  
    }

    inputs {
        query(query_vector) tensor<float>(x[10])
    }
    rank-profile simple_ranker_v1_0_0 {
        first-phase {
                expression: closeness(field, vector_v1_0_0)
        }
    }
}

Right now for every new vector version(vector_v2_0_0, vector_v3_0_0 etc...) I have to create new rank profiles. The feature request is to add the ability to send the embedding vector version dynamically in inputs so that the same rank profile can be used for different embedding vector versions

Describe the solution you'd like
One possible solution could be as follows

schema product {
    
    document product {
        field vector_v1_0_0 type tensor<float>(x[10]) {
            indexing: summary | attribute | index
            attribute {
                distance-metric: dotproduct 
            }
        }  
    }

    inputs {
        query(query_vector) tensor<float>(x[10])
        **query(embedding_vector_version) string**
    }
    rank-profile simple_ranker_v1_0_0 {
        first-phase {
                expression: closeness(field, **embedding_vector_version**)
        }
    }
}

The client can send vector_v2_0_0 or vector_v3_0_0 etc.. in the query(embedding_vector_version) input.

Describe alternatives you've considered
For now I am creating multiple rank-profile functions to support my use case.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions