1

spring mvc プロジェクトで solr を使用しています。

関連するコードは次のとおりです。

私の構成:

<bean id="solrServer" class="org.apache.solr.client.solrj.impl.CommonsHttpSolrServer">
        <constructor-arg value="http://localhost:8180/sorl"/>
        <property name="connectionTimeout" value="1000"/>
        <property name="defaultMaxConnectionsPerHost" value="32"/>
        <property name="maxTotalConnections" value="128"/>
</bean>

私のドメイン:

...
@Entity
@Indexed
@Table(name="MySubject")
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class MySubject extends BaseObject
{

    private static final long serialVersionUID = 1L;

    @Column
    @Field(index=Index.YES, analyze=Analyze.YES, store=Store.NO)
    @org.apache.solr.client.solrj.beans.Field("type")
    private String type;
.....

索引付けコード:

try {
            solrServer.addBean(subject);
            solrServer.commit();
        } catch (IOException | SolrServerException e) {
            e.printStackTrace();
        }

そして、私は例外を得ました:

Bad Request

request: http://localhost:8180/sorl/update?wt=javabin&version=2
    at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:427)
    at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:249)
    at org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:105)
    at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:121)
    at org.apache.solr.client.solrj.SolrServer.addBean(SolrServer.java:143)
    at org.apache.solr.client.solrj.SolrServer.addBean(SolrServer.java:131)

solr サーバーでは、ログは次のとおりです。

org.apache.solr.common.SolrException log
SEVERE: org.apache.solr.common.SolrException: ERROR: [doc=null] unknown field 'type'
    at org.apache.solr.update.DocumentBuilder.toDocument(DocumentBuilder.java:340)
    at org.apache.solr.update.processor.RunUpdateProcessor.processAdd(RunUpdateProcessorFactory.java:60)
    at org.apache.solr.update.processor.LogUpdateProcessor.processAdd(LogUpdateProcessorFactory.java:115)
    at org.apache.solr.handler.XMLLoader.processUpdate(XMLLoader.java:157)
    at org.apache.solr.handler.XMLLoader.load(XMLLoader.java:79)
    at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:58)
    at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
    at org.apache.solr.core.SolrCore.execute(SolrCore.java:1376)
    at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:365)
    at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:260)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1815)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)

親切に私を助けてください。

4

0 に答える 0