tihom88 commented on code in PR #2269: URL: https://github.com/apache/jackrabbit-oak/pull/2269#discussion_r2079397813
########## oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/query/inference/InferenceModelConfig.java: ########## @@ -0,0 +1,176 @@ +/* + * 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.jackrabbit.oak.plugins.index.elastic.query.inference; + +import org.apache.jackrabbit.oak.plugins.index.elastic.util.EnvironmentVariableProcessorUtil; +import org.apache.jackrabbit.oak.spi.query.fulltext.InferenceQueryConfig; +import org.apache.jackrabbit.oak.spi.state.NodeState; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import static org.apache.jackrabbit.oak.plugins.index.search.util.ConfigUtil.getOptionalValue; + +/** + * Configuration class for Inference Model settings. + * Currently only hybrid search is implemented + */ +public class InferenceModelConfig { + private static final Logger log = LoggerFactory.getLogger(InferenceModelConfig.class); + private static final String DEFAULT_ENVIRONMENT_VARIABLE_VALUE = ""; + + public static final InferenceModelConfig NOOP = new InferenceModelConfig(); + public static final String MODEL = "model"; + public static final String EMBEDDING_SERVICE_URL = "embeddingServiceUrl"; + public static final String SIMILARITY_THRESHOLD = "similarityThreshold"; + public static final String INFERENCE_PAYLOAD = "inferencePayload"; + // InferenceQueryConfig also uses InferenceModelConfig.TYPE so referencing + // it from InferenceQueryConfig. + public static final String TYPE = InferenceQueryConfig.TYPE; + public static final String MIN_TERMS = "minTerms"; + public static final String IS_DEFAULT = "isDefault"; + public static final String ENABLED = "enabled"; + public static final String HEADER = "header"; + public static final String TIMEOUT = "timeout"; + public static final String NUM_CANDIDATES = "numCandidates"; + public static final String CACHE_SIZE = "cacheSize"; + private static final double DEFAULT_SIMILARITY_THRESHOLD = 0.8; + private static final long DEFAULT_MIN_TERMS = 2; + private static final long DEFAULT_TIMEOUT_MILLIS = 5000L; + private static final int DEFAULT_NUM_CANDIDATES = 100; + private static final int DEFAULT_CACHE_SIZE = 100; + + + private final String model; Review Comment: Will open an issue for this. -- 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: oak-dev-unsubscr...@jackrabbit.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org