我在 Windows 7 上使用 Solr 6.1。
我从管理用户界面看到我的收藏文件,它有一个 managed-schema
文件在那里。
当我尝试使用托管架构文件中的一行搜索(使用 Notepad++)我的 Solr 目录时,它什么也没找到。
我还尝试更改 managed-schema
的大部分(如果不是全部) Solr 目录中的文件和我的更改在重新加载核心后仍然没有应用(并且管理 UI 中 managed-schema
的文件内容保持不变)。
有人可以向我解释我在管理 UI 中看到的这个文件是什么吗?
它是真实文件还是虚拟文件?
我试图做的 - 如果这很重要 - 是使某些字段不被多值化。似乎 Solr 出于某种原因喜欢将它们全部设为多值(管理 UI 的 managed-schema
文件中包含一些 <field name="fieldname" type="strings"/>
,所以我认为这是导致问题的原因 - 我将尝试在那里使用 string
),所以我正在战斗更改其配置。但是,文件名、文件路径等似乎都在随着版本的不同而变化。所以,我什至找不到架构配置路径。很困惑的东西。 :(
任何人都可以帮忙吗?
编辑:
基于我找不到一个 schema.xml
的事实我的 Solr 文件夹中的配置文件,我猜这个文件现在已经过时了...我 猜 在这个版本的 Solr 中尝试使用这样的文件是没有意义的......
更新:
在深入研究了 Solr 的(无用的和误导性的)文档页面以外的地方之后,我得到了这些:
https://mail-archives.apache.org/mod_mbox/lucene-solr-user/201509.mbox/
https://mail-archives.apache.org/mod_mbox/lucene-solr-user/201509.mbox/
所以,如果那是真正的文档,我想我应该首先找到一种方法来获取我的zookeeper正在监听的端口并将我的配置文件上传到那里。 Dandy,除了我在 adminUI 中的任何地方都没有看到 ZooKepeer 端口。我也没有设置任何 ZooKeeper。我希望默认情况下存在一个... :(
更新 2:
https://wiki.apache.org/solr/SolrCloud
By default, an embedded Zookeeper server runs at the Solr port plus 1000, so 9983.
这些信息似乎解决了我的工作问题...
最佳答案
只需将托管模式重命名为 架构.xml。
然后重新加载一个核心。
If you have an existing Solr collection that uses ClassicIndexSchemaFactory, and you wish to convert to use a managed schema, you can simplify modify the solrconfig.xml to specify the use of the ManagedIndexSchemaFactory. Once Solr is restarted and it detects that a schema.xml file exists, but the managedSchemaResourceName file (ie: "managed-schema") does not exist, the existing schema.xml file will be renamed to schema.xml.bak and the contents are re-written to the managed schema file. If you look at the resulting file, you'll see this at the top of the page:
请仔细阅读。
从 schema.xml 切换到托管架构
An alternative to using a managed schema is to explicitly configure a ClassicIndexSchemaFactory. ClassicIndexSchemaFactory requires the use of a schema.xml configuration file, and disallows any programatic changes to the Schema at run time. The schema.xml file must be edited manually and is only loaded only when the collection is loaded.
<schemaFactory class="ClassicIndexSchemaFactory"/>
https://cwiki.apache.org/confluence/display/solr/Schema+Factory+Definition+in+SolrConfig
更新 :
更改为手动编辑的 schema.xml
如果您在启用托管架构的情况下启动了 Solr,并且您想切换到手动编辑 schema.xml 文件,您应该执行以下步骤:
替换 schemaFactory 类。
ManagedIndexSchemaFactory 定义(如果存在)
ClassicIndexSchemaFactory 定义如上所示 重新加载
核心。
关于Solr 6.1 - 我收藏的 `managed-schema` 文件在哪里,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37989084/