[ 
https://issues.apache.org/jira/browse/SOLR-17164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17826907#comment-17826907
 ] 

Chris M. Hostetter commented on SOLR-17164:
-------------------------------------------

FYI I had some time to look at this more today to try and work on some of the 
tests i suggested, and confirmed this is a problem...
{quote}
 * Can you please add some tests where a constant vector is provided using a 
request param reference
 ** ie: {{vectorSimilarity(fieldName,$vec_param)}}
 ** (I'm not sure off the top of my head if param refs are resolved by the time 
we'll be making the {{peek()}} call)
{quote}
...i've been reviewing the helper code in FunctionQParser a bit and i think i 
have a pretty good idea how to fix it, i'll try to dig in more tomorrow.

> Add 2 arg variant of vectorSimilarity() function
> ------------------------------------------------
>
>                 Key: SOLR-17164
>                 URL: https://issues.apache.org/jira/browse/SOLR-17164
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Chris M. Hostetter
>            Priority: Major
>              Labels: vector-based-search
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Solr's current 4 argument 
> {{vectorySimilarity(vectorEncoding,similarityFunction,vec1,vec2)}} function 
> is really awkward to use for the (seemingly common) situation where you just 
> want to know the similarity between a field and a constant vector, or 
> (probably less common) between two fields of the same type.
> The first two (currently) mandatory arguments to {{vectorySimilarity()}} 
> ({{{}vectorEncoding{}}} and {{{}similarityFunction{}}}) are already mandatory 
> properties of {{{}DenseVectorField{}}}. IIUC the only reason these arguments 
> are required is in the (seemingly uncommon?) situation where you might want 
> to compute the similarity of two vector constants, so the function needs to 
> know what {{vectorEncoding}} and {{similarityFunction}} to use.
>  
> ----
>  
> It would be really nice to support a simplified 2 argument variant of 
> {{vectorySimilarity()}} such that:
>  * the first argument must be the name of a {{DenseVectorField}} field
>  * the second argument must be either:
>  ** A vector constant
>  *** in which case the {{vectorEncoding}} use to parse the constant is 
> infered from the fieldType properties of the first argument
>  ** Or the name of a second {{DenseVectorField}} field
>  *** in which case the {{vectorEncoding}} and {{similarityFunction}} of the 
> two fields must match
>  * The ValueSource returned should be based on the configured 
> {{vectorEncoding}} & {{similarityFunction}} of the field(s)
> Examples...
> {noformat}
> vectorySimilarity(title_float_vec_dim4, [1.0,2.0,3.0,4.0])
>    ...or...
> vectorySimilarity(title_float_vec_dim4, body_float_vec_dim4)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to