title: Use Point field in cosineSimilarity (Solr streaming expression)
body: <p>I have a &quot;cze&quot; field in the document schema of Solr 9 defined with</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;field name=&quot;cze&quot; type=&quot;feature_vector_1024d&quot; uninvertible=&quot;false&quot; indexed=&quot;true&quot; stored=&quot;true&quot;/&gt;
  </code></pre>
  <p>where &quot;feature_vector_1024d&quot; type defined as</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;fieldType name=&quot;feature_vector_1024d&quot; class=&quot;solr.PointType&quot; subFieldSuffix=&quot;_d&quot; dimension=&quot;1024&quot; docValues=&quot;true&quot;/&gt;
  </code></pre>
  <p>I want to use this field in the solr streaming expression to calculate cosine similarity with a constant vector.</p>
  <p>My streaming expression is</p>
  <pre><code>top(n=100,
      having(
          select(
              search(myCollection1,q=&quot;animal:Dog AND card_type:Lost&quot;,fl=&quot;id, event_time,
                  cze_0_d,cze_1_d,cze_2_d,cze_3_d,cze_4_d&quot;,sort=&quot;event_time asc&quot;,qt=&quot;/export&quot;),id,
                  cosineSimilarity(
                      array(cze_0_d,cze_1_d,cze_2_d,cze_3_d,cze_4_d),
                      array(0.019,-0.026,0.001,-0.066,0.033))
                      as similarity),
      gt(similarity, 0.3)),
  sort=&quot;similarity desc&quot;)
  </code></pre>
  <p>The example only uses 5 components (cze_0_d,cze_1_d,...) out of 1024 for simplicity. But actually I need to use all of 1024 in cosine similarity.</p>
  <p>My question is, how can I avoid &quot;composing&quot; array <code>array(cze_0_d,cze_1_d,cze_2_d,...,cze_1023_d)</code> in the expression of out point component and use entire cze instead?</p>
  <p>I suspect composing array like <code>array(cze_0_d,...,cze_1023_d)</code> is very inefficient in terms of query performance.</p>
  <p>Ideally I would use <code>cosineSimilarity(array(cze),array(0.019,-0.026,..., 0.001,-0.066,0.033)</code> but this constract results in <code>Cannot invoke \&quot;java.lang.Number.doubleValue()\&quot; because \&quot;value\&quot; is null</code> exception.</p>