This is an automated email from the ASF dual-hosted git repository.

hossman pushed a commit to branch jira/SOLR-17975
in repository https://gitbox.apache.org/repos/asf/solr.git

commit bf9713a602678e72efb8f4d015888694f6833c17
Author: Chris Hostetter <[email protected]>
AuthorDate: Thu Jan 15 14:38:30 2026 -0700

    refactor string specific aspects about value source parsing into the field 
type
---
 .../org/apache/solr/schema/LateInteractionVectorField.java   | 12 ++++++++++--
 .../src/java/org/apache/solr/search/ValueSourceParser.java   |  7 +++----
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git 
a/solr/core/src/java/org/apache/solr/schema/LateInteractionVectorField.java 
b/solr/core/src/java/org/apache/solr/schema/LateInteractionVectorField.java
index e00e47bd02a..ca50cd748c5 100644
--- a/solr/core/src/java/org/apache/solr/schema/LateInteractionVectorField.java
+++ b/solr/core/src/java/org/apache/solr/schema/LateInteractionVectorField.java
@@ -38,6 +38,7 @@ import org.apache.lucene.search.SortField;
 import org.apache.lucene.util.BytesRef;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.response.TextResponseWriter;
+import org.apache.solr.search.FunctionQParser;
 import org.apache.solr.search.QParser;
 import org.apache.solr.search.StrParser;
 import org.apache.solr.search.SyntaxError;
@@ -127,8 +128,15 @@ public class LateInteractionVectorField extends FieldType {
     return scoreFunction;
   }
 
-  public DoubleValuesSource getMultiVecSimilarityValueSource(
-      final String fieldName, final String vecStr) throws SyntaxError {
+  // nocommit: jdocs
+  public DoubleValuesSource parseLateInteractionValuesSource(
+      final String fieldName, final FunctionQParser fp) throws SyntaxError {
+    final String vecStr = fp.parseArg();
+    if (null == vecStr || fp.hasMoreArguments()) {
+      throw new SolrException(
+          SolrException.ErrorCode.BAD_REQUEST,
+          "Invalid number of arguments. Please provide both a field name, and 
a (String) multi-vector.");
+    }
     return new LateInteractionFloatValuesSource(
         fieldName,
         stringToMultiFloatVector(dimension, vecStr),
diff --git a/solr/core/src/java/org/apache/solr/search/ValueSourceParser.java 
b/solr/core/src/java/org/apache/solr/search/ValueSourceParser.java
index b8b2251af1b..012aca0fa32 100644
--- a/solr/core/src/java/org/apache/solr/search/ValueSourceParser.java
+++ b/solr/core/src/java/org/apache/solr/search/ValueSourceParser.java
@@ -1370,16 +1370,15 @@ public abstract class ValueSourceParser implements 
NamedListInitializedPlugin {
           public ValueSource parse(final FunctionQParser fp) throws 
SyntaxError {
 
             final String fieldName = fp.parseArg();
-            final String vecStr = fp.parseArg();
-            if (null == fieldName || null == vecStr || fp.hasMoreArguments()) {
+            if (null == fieldName) {
               throw new SolrException(
                   SolrException.ErrorCode.BAD_REQUEST,
-                  "Invalid number of arguments. Please provide both a field 
name, and a (String) multi-vector.");
+                  "Invalid arguments. First argument must be a field name");
             }
             final FieldType ft = 
fp.getReq().getSchema().getFieldType(fieldName);
             if (ft instanceof LateInteractionVectorField lift) {
               return ValueSource.fromDoubleValuesSource(
-                  lift.getMultiVecSimilarityValueSource(fieldName, vecStr));
+                  lift.parseLateInteractionValuesSource(fieldName, fp));
             }
             throw new SolrException(
                 SolrException.ErrorCode.BAD_REQUEST,

Reply via email to