Hi
I'm trying to use streaming expressions to make some queries using the
Dense Vectors and KNN queries introduced in Solr 9.
For instance, as per Dense Vector Search documentation, I could do a query
like this:
&q={!knn f=film_vector topK=10}[1.0, 2.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0,
10.0]
I was wondering rather it is possible to do exactly this same query, but
using Streaming Expressions, and the array/vector coming from a variable.
Imagine that the target vector variable would come from a more complex
calculation, but to simplify my example I define it as hard-coded in the
expression. Something like this:
let(
target_vector=array(1.0, 2.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0)
resulting_documents=search(films, q="{!knn f=film_vector topK=10}$
target_vector")
)
The above expression does not work. I also tried inputting the
"target_vector" variable without the ampersand (&), but it does not work
either.
In summary: is it possible to use streaming variables inside query strings.
More specifically, is it possible to use streaming arrays as target Dense
Vectors in KNN queries?
Best,
--
Gabriel Magno