Solr 9.2.1 カスタムプラグインが solrconfig.xml から値を読み込む方法

トピック作成者:ks-solruserml-bot (2024/09/01 21:31 投稿)
3
(The bot translated the original post https://lists.apache.org/thread/y7v9fyyhwod6scpkr9gjktn35pl9pgjm into Japanese and reposted it under Apache License 2.0. The copyright of posted content is held by the original poster.)
こんにちは、
私たちは、Solr 7.3.1 から Solr 9.2.1 への移行作業を行っており、カスタムプラグインも移行しています。
私たちの solrconfig.xml には、次のような行があります:
<valueSourceParser name="stopwordsw"
class="com.cie.lbs.solr.search.function.StopWordSubtypeValueSourceParser"
stopwords="le;la;les;"
startswith="3"
/>
ここで、stopwords と startswith の値は solrconfig で定義されており、SolrEventListener を実装したクラスの newSearcher メソッドでこれらの値を読み込んでいます。
public void newSearcher(SolrIndexSearcher newSearcher,
SolrIndexSearcher currentSearcher) {
SolrConfig config = newSearcher.getCore().getSolrConfig();
String functionName = "//valueSourceParser[@name='" + this.name + "']";
String[] stopWords = config.get(functionName + "/@stopwords").txt().split(";");
StopWordSubtypeLoader.startsWithValue = Integer.parseInt(config.get(
functionName + "/@startswith").txt());
StopWordSubtypeLoader.stopWords = new HashSet<String>(Arrays.asList(stopWords));
LOGGER.info("startsWithValue = " + StopWordSubtypeLoader.startsWithValue);
LOGGER.info("stopwords = " + String.join(",", StopWordSubtypeLoader.stopWords));
}
これは Solr 7.3.1 では機能していましたが、Solr 9.2.1 では機能しません。ユニットテストで newSearcher メソッドにブレークポイントを設定しても、そこに到達しないようで、newSearcher が呼び出されていないようです。
何か変更があったのでしょうか?Solr 9 の類似のケースについての例を見つけることができませんでした。
よろしくお願いします、
Elisabeth
トピックへ返信するには、ログインが必要です。