Solr数据导入已获取12/12,但已处理0/12

时间:2019-03-18 19:13:23

标签: solr

solr7.5

尝试调试我的Solr数据导入。在solr ui上查看日志可以得到以下信息:

enter image description here

我一直在查看我的solrconfig.xml,schema.xml和db-config.xml。 下面是架构和dbconfig

SCHEMA

<?xml version="1.0" encoding="UTF-8"?>
<schema name="testing" version="1.6">
    <uniqueKey>id</uniqueKey>
    <types>
        <fieldtype name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true" />
        <fieldType name="plong" class="solr.LongPointField" docValues="true"/>
        <fieldtype name="ignored" stored="false" indexed="false" multiValued="true" class="solr.StrField" />
        <fieldType name="pdate" class="solr.DatePointField" sortMissingLast="true" />
        <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100" multiValued="true">
        <analyzer type="index">
          <tokenizer class="solr.StandardTokenizerFactory"/>
          <filter class="solr.StopFilterFactory" words="stopwords.txt" ignoreCase="true"/>
          <filter class="solr.LowerCaseFilterFactory"/>
        </analyzer>
        <analyzer type="query">
          <tokenizer class="solr.StandardTokenizerFactory"/>
          <filter class="solr.StopFilterFactory" words="stopwords.txt" ignoreCase="true"/>
          <filter class="solr.SynonymGraphFilterFactory" expand="true" ignoreCase="true" synonyms="synonyms.txt"/>
          <filter class="solr.LowerCaseFilterFactory"/>
        </analyzer>
    </fieldType>
    </types>
    <field name="_version_" type="plong" indexed="true" stored="true"/>
    <field name="Problem" type="text_general" indexed="true" stored="true" multiValued="false"/>
    <field name="Solution" type="text_general" indexed="true" stored="true" multiValued="false"/>
    <field name="_text_" type="text_general" multiValued="false" indexed="true" stored="false"/>
    <field name="date" type="pdate" multiValued="false" indexed="true" stored="true"/>
    <field name="id" type="string" multiValued="false" indexed="true" required="true" stored="true"/>
    <copyField source="*" dest="_text_"/>
</schema>

DB-CONFIG

<dataConfig>
<dataSource type="JdbcDataSource"
            driver="com.mysql.cj.jdbc.Driver"
            url="jdbc:mysql://localhost:3306/solrtest"
            user="root"
            password=""/>
    <document>
    <entity name="solr"
            pk="id"
            query="select * from solr"
        >
        <field column="id" name="id"/>
        <field column="date" name="date"/>
        <field column="Problem" name="Problem"/>
        <field column="Solution" name="Solution"/>
    </entity>
    </document>
</dataConfig>

Ive对solrconfig所做的更改包括以下内容:

更改了此内容

  <updateRequestProcessorChain name="add-unknown-fields-to-the-schema" default="${update.autoCreateFields:false}"
           processor="uuid,remove-blank,field-name-mutating,parse-boolean,parse-long,parse-double,parse-date"><!--,add-schema-fields-->
    <processor class="solr.LogUpdateProcessorFactory"/>
    <processor class="solr.DistributedUpdateProcessorFactory"/>
    <processor class="solr.RunUpdateProcessorFactory"/>
  </updateRequestProcessorChain>

添加了此内容

  <schemaFactory class="ClassicIndexSchemaFactory"/>

对此评论:

<updateRequestProcessorChain name="add-unknown-fields-to-the-schema" default="${update.autoCreateFields:false}"
           processor="uuid,remove-blank,field-name-mutating,parse-boolean,parse-long,parse-double,parse-date"><!--,add-schema-fields-->
    <processor class="solr.LogUpdateProcessorFactory"/>
    <processor class="solr.DistributedUpdateProcessorFactory"/>
    <processor class="solr.RunUpdateProcessorFactory"/>
  </updateRequestProcessorChain>

我正在寻找有关错误的更多详细信息的帮助。

将Debug和Verbose添加到导入尝试中时,出现错误提示 enter image description here

在此错误内,我得到以下信息

null:java.lang.UnsupportedOperationException
    at java.sql/java.sql.Date.toInstant(Date.java:316)
    at org.apache.solr.common.util.TextWriter.writeDate(TextWriter.java:163)
    at org.apache.solr.common.util.TextWriter.writeVal(TextWriter.java:61)
    at org.apache.solr.response.TextResponseWriter.writeVal(TextResponseWriter.java:152)
    at org.apache.solr.common.util.JsonTextWriter.writeJsonIter(JsonTextWriter.java:194)
    at org.apache.solr.common.util.JsonTextWriter.writeArray(JsonTextWriter.java:276)
    at org.apache.solr.common.util.TextWriter.writeVal(TextWriter.java:78)
    at org.apache.solr.response.TextResponseWriter.writeVal(TextResponseWriter.java:152)
    at org.apache.solr.common.util.JsonTextWriter.writeMap(JsonTextWriter.java:258)
    at org.apache.solr.common.util.TextWriter.writeVal(TextWriter.java:74)
    at org.apache.solr.response.TextResponseWriter.writeVal(TextResponseWriter.java:152)
    at org.apache.solr.common.util.JsonTextWriter.writeJsonIter(JsonTextWriter.java:194)
    at org.apache.solr.common.util.JsonTextWriter.writeArray(JsonTextWriter.java:276)
    at org.apache.solr.common.util.TextWriter.writeVal(TextWriter.java:78)
    at org.apache.solr.response.TextResponseWriter.writeVal(TextResponseWriter.java:152)
    at org.apache.solr.common.util.JsonTextWriter.writeNamedListAsMapWithDups(JsonTextWriter.java:386)
    at org.apache.solr.common.util.JsonTextWriter.writeNamedList(JsonTextWriter.java:292)
    at org.apache.solr.response.JSONWriter.writeResponse(JSONWriter.java:73)
    at org.apache.solr.response.JSONResponseWriter.write(JSONResponseWriter.java:66)
    at org.apache.solr.response.QueryResponseWriterUtil.writeQueryResponse(QueryResponseWriterUtil.java:65)
    at org.apache.solr.servlet.HttpSolrCall.writeResponse(HttpSolrCall.java:787)
    at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:524)
    at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:377)
    at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:323)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1634)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1317)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1219)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:219)
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
    at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:335)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
    at org.eclipse.jetty.server.Server.handle(Server.java:531)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:352)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
    at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
    at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:762)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:680)
    at java.base/java.lang.Thread.run(Thread.java:834)

用户图片: enter image description here

1 个答案:

答案 0 :(得分:1)

我的解决方案来自为问题和解决方案添加一个copyField。这样,我将 text 更改为多值。然后,在重新启动solr之后,我可以根据需要索引我的信息。

<copyField source="Problem" dest="_text_"/>
<copyField source="Solution" dest="_text_"/>