gpt4 book ai didi

Solr 添加文档时出错

转载 作者:行者123 更新时间:2023-12-02 04:15:31 25 4
gpt4 key购买 nike

我创建了一个名为“fuzzy”的 solr 核心,但是我无法将文档添加到核心,我尝试使用以下 URL 添加文档:

http://localhost:8983/solr/Fuzzy/update?stream.body=<add><doc><field%20name="id">1</field><field%20name="original">München</field><field%20name="mutation">Munchen</field></doc></add>&commit=true

但我不断收到消息L

unknown UpdateRequestProcessorChain: add-unknown-fields-to-the-schema

我不确定为什么会收到此消息,在我的配置文件中:

<schemaFactory class="ClassicIndexSchemaFactory"/>

和 schema.xml :

<?xml version="1.0" encoding="UTF-8" ?>
<schema name="WikiData" version="1.5">
<field name="id" type="int" indexed="true" stored="true" required="true" multiValued="false" />
<field name="original" type="text_general" indexed="true" stored="true" />
<field name="mutation" type="text_general" indexed="true" stored="true" />
<field name="_version_" type="long" indexed="true" stored="true"/>
<uniqueKey>id</uniqueKey>

<fieldType name="int" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0"/>
<fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/>
<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100" multiValued="false">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
</fieldType>
</schema>

solrconfig.xml:

<?xml version="1.0" encoding="UTF-8" ?>
<config>
<luceneMatchVersion>5.3.1</luceneMatchVersion>
<lib dir="${solr.install.dir:../../../..}/contrib/extraction/lib" regex=".*\.jar" />
<lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-cell-\d.*\.jar" />

<lib dir="${solr.install.dir:../../../..}/contrib/clustering/lib/" regex=".*\.jar" />
<lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-clustering-\d.*\.jar" />

<lib dir="${solr.install.dir:../../../..}/contrib/langid/lib/" regex=".*\.jar" />
<lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-langid-\d.*\.jar" />

<lib dir="${solr.install.dir:../../../..}/contrib/velocity/lib" regex=".*\.jar" />
<lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-velocity-\d.*\.jar" />
<dataDir>${solr.data.dir:}</dataDir>
<directoryFactory name="DirectoryFactory"
class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"/>
<codecFactory class="solr.SchemaCodecFactory"/>

<schemaFactory class="ClassicIndexSchemaFactory"/>
<indexConfig>
<lockType>${solr.lock.type:native}</lockType>
</indexConfig>
<jmx />
<updateHandler class="solr.DirectUpdateHandler2">
<updateLog>
<str name="dir">${solr.ulog.dir:}</str>
<int name="numVersionBuckets">${solr.ulog.numVersionBuckets:65536}</int>
</updateLog>
<autoCommit>
<maxTime>${solr.autoCommit.maxTime:15000}</maxTime>
<openSearcher>false</openSearcher>
</autoCommit>
<autoSoftCommit>
<maxTime>${solr.autoSoftCommit.maxTime:-1}</maxTime>
</autoSoftCommit>
</updateHandler>

<query>
<maxBooleanClauses>1024</maxBooleanClauses>
<filterCache class="solr.FastLRUCache"
size="512"
initialSize="512"
autowarmCount="0"/>

<queryResultCache class="solr.LRUCache"
size="512"
initialSize="512"
autowarmCount="0"/>

<documentCache class="solr.LRUCache"
size="512"
initialSize="512"
autowarmCount="0"/>
<cache name="perSegFilter"
class="solr.search.LRUCache"
size="10"
initialSize="0"
autowarmCount="10"
regenerator="solr.NoOpRegenerator" />
<enableLazyFieldLoading>true</enableLazyFieldLoading>

<queryResultWindowSize>20</queryResultWindowSize>
<queryResultMaxDocsCached>200</queryResultMaxDocsCached>
<listener event="newSearcher" class="solr.QuerySenderListener">
<arr name="queries">
</arr>
</listener>
<listener event="firstSearcher" class="solr.QuerySenderListener">
<arr name="queries">
</arr>
</listener>
<useColdSearcher>false</useColdSearcher>
<maxWarmingSearchers>2</maxWarmingSearchers>

</query>
<requestDispatcher handleSelect="false" >
<requestParsers enableRemoteStreaming="true"
multipartUploadLimitInKB="2048000"
formdataUploadLimitInKB="2048"
addHttpRequestToContext="false"/>
<httpCaching never304="true" />
</requestDispatcher>
<requestHandler name="/select" class="solr.SearchHandler">

<admin>
<defaultQuery>*:*</defaultQuery>
</admin>

</config>

最佳答案

默认的托管架构 the documentation建议应复制到 schema.xml 中,其中包含更新处理器请求链,在不使用托管架构时不需要该链。 (或者至少在 6.1.0 中是这样)

应从 solrconfig.xml 中删除或注释掉以下行:

<initParams path="/update/**">
<lst name="defaults">
<str name="update.chain">add-unknown-fields-to-the-schema</str>
</lst>
</initParams>

另一种选择可能是继续使用托管模式而不是经典方法,但将其设置为不可变,尽管我还没有测试过这一点,例如

<schemaFactory class="ManagedIndexSchemaFactory">
<bool name="mutable">false</bool>
<str name="managedSchemaResourceName">managed-schema</str>
</schemaFactory>

关于Solr 添加文档时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34066724/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com