在Solr Cloud schema.xml和lucene Monitor之间共享lucene分析器



我正在尝试配置Lucene Monitor的实例(https://lucene.apache.org/core/8_6_0/monitor/index.html)。Monitor api要求您提供一个Analyzer实例。我已经有了一个单独的Apache Solr Cloud设置,在zookeeper中有一个schema.xml配置文件,我想为特定的Solr字段重用该schema.xml文件中的配置。

有什么最佳实践可以帮助你做到这一点吗?

我创建了一个spring-api服务,该服务使用solr核心包中的solrj客户端连接到zookeeper并将配置下载到本地dir。之后,监视服务使用此配置来创建Indexschema对象和查询解析器。您可以从DocumentBuilder.toDocument(SolrInputDocument文档,IndexSchema架构(中获取lucene Document对象,并将其传递给监视器。

类似地,在注册查询时,可以使用indexschema返回的分析器创建查询对象。

最新更新