dsmiley commented on code in PR #3476: URL: https://github.com/apache/solr/pull/3476#discussion_r2328955633
########## solr/modules/llm/src/java/org/apache/solr/llm/textvectorisation/model/CustomModel.java: ########## @@ -0,0 +1,110 @@ +package org.apache.solr.llm.textvectorisation.model; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import dev.langchain4j.data.embedding.Embedding; +import dev.langchain4j.data.segment.TextSegment; +import dev.langchain4j.model.embedding.DimensionAwareEmbeddingModel; +import dev.langchain4j.model.output.Response; +import java.io.IOException; +import java.time.Duration; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.apache.http.HttpEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.util.EntityUtils; Review Comment: No; let's please not use Apache HttpClient https://issues.apache.org/jira/browse/SOLR-16367 ########## solr/modules/llm/src/java/org/apache/solr/llm/textvectorisation/update/processor/TextToVectorUpdateProcessorFactory.java: ########## @@ -70,13 +70,11 @@ public void init(final NamedList<?> args) { public UpdateRequestProcessor getInstance( SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next) { IndexSchema latestSchema = req.getCore().getLatestSchema(); - - if (!latestSchema.isDynamicField(inputField) && !latestSchema.hasExplicitField(inputField)) { + if (!latestSchema.hasExplicitField(inputField)) { throw new SolrException( SolrException.ErrorCode.SERVER_ERROR, "undefined field: \"" + inputField + "\""); } - - if (!latestSchema.isDynamicField(outputField) && !latestSchema.hasExplicitField(outputField)) { + if (!latestSchema.hasExplicitField(outputField)) { throw new SolrException( SolrException.ErrorCode.SERVER_ERROR, "undefined field: \"" + outputField + "\""); } Review Comment: I don't know why these checks are here _at all_. `org.apache.solr.schema.IndexSchema#getField` (called immediately below) is going to throw an exception with a specific error message about the field being undefined. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
