无法创建solr核心:_version_字段必须存在于架构中,并且是可搜索和可检索的,而不是多值的

wkyowqbh  于 2022-10-21  发布在  Solr
关注(0)|答案(1)|浏览(136)

完全错误:

Error CREATEing SolrCore 'product_v2': Unable to create core [product_v2] Caused by: _version_ field must exist in schema and be searchable (indexed or docValues) and retrievable(stored or docValues) and not multiValued (_version_ is multiValued

架构.xml

<?xml version="1.0" encoding="UTF-8" ?>
<schema name="product_v2" version="1.5">

    <field name="_version_" type="long" indexed="true" stored="true" multiValued="false"/>

    <!-- points to the root document of a block of nested documents. Required for nested
       document support, may be removed otherwise
    -->
    <field name="_root_" type="string" indexed="true" stored="false"/>

    <!-- Only remove the "id" field if you have a very good reason to. While not strictly
      required, it is highly recommended. A <uniqueKey> is present in almost all Solr
      installations. See the <uniqueKey> declaration below where <uniqueKey> is set to "id".
    -->
    <field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false" />
    <field name="sku" type="string" indexed="true" stored="true" required="true" multiValued="false" />
    <field name="title" type="string" indexed="true" stored="true" required="true" multiValued="false" />
    <field name="type" type="string" indexed="true" stored="true" required="true" multiValued="false" />

    <!-- Field to use to determine and enforce document uniqueness.
         Unless this field is marked with required="false", it will be a required field
      -->
    <uniqueKey>id</uniqueKey>

    <fieldType name="string" class="solr.StrField" sortMissingLast="true" />
    <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
    <fieldType name="int" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0"/>
    <fieldType name="float" class="solr.TrieFloatField" precisionStep="0" positionIncrementGap="0"/>
    <fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/>
    <fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" positionIncrementGap="0"/>
</schema>

不幸的是,我不知道该怎么办。据我所知,该版本符合所有要求。我在过去使用过大量Solr,没有问题,但这是我第一次使用Solrcloud+Zookeeper。
Solr版本为6.3.0

vfhzx4xs

vfhzx4xs1#

好吧……所以我没有一个确切的答案,但我确实解决了这个问题,所以我想我会提供我为使事情正常运行所做的事情的信息。
1) 我决定只让示例工作,然后剥离功能
2) 我没有为集合核心创建solr文件夹,也没有为文件分配适当的所有权(对我来说,它在/usr/local/solr/server/solr中)…我认为没有核心。属性文件把事情搞砸了。
3) 上传到zookeeper后,我没有从solr目录中删除配置文件(不认为这很重要,但想注意)
4) 我没有重新启动solr,我只是使用API重新加载

相关问题