vigyasharma commented on code in PR #14729:
URL: https://github.com/apache/lucene/pull/14729#discussion_r2193381677


##########
lucene/core/src/java/org/apache/lucene/document/LateInteractionField.java:
##########
@@ -0,0 +1,138 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.lucene.document;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.FloatBuffer;
+import org.apache.lucene.util.BytesRef;
+
+/**
+ * A field for storing multi-vector values for late interaction models.
+ *
+ * <p>The value is stored as a binary payload, and can be retrieved using 
{@link
+ * LateInteractionField#decode(BytesRef)}. Multi-vectors are expected to have 
the same dimension for
+ * each composing token vector. This is stored along with the token vectors in 
the first 4 bytes of
+ * the payload.
+ *
+ * <p>Note: This field does not ensure consistency in token vector dimensions 
for values across
+ * documents.
+ */
+public class LateInteractionField extends BinaryDocValuesField {
+
+  /**
+   * Creates a new {@link LateInteractionField} from the provided multi-vector 
matrix.
+   *
+   * @param name field name
+   * @param value multi-vector value
+   */
+  public LateInteractionField(String name, float[][] value) {

Review Comment:
   Yes, it expects the value to be a 2D float array. This [lucene 
test](https://github.com/apache/lucene/pull/14729/files) has a java example for 
the same. 
   
   Is the http request above from OpenSearch? I suppose you need to add a 
corresponding field there first, that maps to the `LateInteractionField`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to