server/src/main/java/org/elasticsearch/index/mapper/vectors/DenseVectorFieldMapper.java
fieldMapper.checkDimensionMatches(index, context);
                checkVectorBounds(vector);
                checkVectorMagnitude(fieldMapper.similarity, errorFloatElementsAppender(vector), squaredMagnitude);
                return createKnnVectorField(fieldMapper.fieldType().name(), vector, fieldMapper.similarity.function);
            }
            @Override
            double parseKnnVectorToByteBuffer(DocumentParserContext context, DenseVectorFieldMapper fieldMapper, ByteBuffer byteBuffer)
                throws IOException {
                double dotProduct = 0f;
                int index = 0;
                float[] vector = new float[fieldMapper.dims];
                for (Token token = context.parser().nextToken(); token != Token.END_ARRAY; token = context.parser().nextToken()) {
                    fieldMapper.checkDimensionExceeded(index, context);
                    ensureExpectedToken(Token.VALUE_NUMBER, token, context.parser());
                    float value = context.parser().floatValue(true);
                    vector[index] = value;
                    byteBuffer.putFloat(value);
                    dotProduct += value * value;
                    index++;
                }
                fieldMapper.checkDimensionMatches(index, context);
                checkVectorBounds(vector);
                return dotProduct;
            }
        };
        final int elementBytes;
        ElementType(int elementBytes) {
            this.elementBytes = elementBytes;
        }
        public abstract void writeValue(ByteBuffer byteBuffer, float value);