user1163415
user1163415

Reputation: 45

Error when indexing content from MySQL database in Apache Solr

When I am indexing the data from a MySQL database to an Apache Solr server running under Tomcat6 on port 8180, I am receiving a 400 Bad Request error message. Upon investigating the server logs for tomcat6, the following is the exception message:

INFO: {add=[(null)]} 0 1
Jan 25, 2012 3:37:46 AM org.apache.solr.common.SolrException log
SEVERE: org.apache.solr.common.SolrException: ERROR: [doc=null] unknown field 'job_id'
        at org.apache.solr.update.DocumentBuilder.toDocument(DocumentBuilder.java:331)
        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:158)
        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:1372)
        at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:356)
        at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:252)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:662)

Please tell me any solution to this....

Thanks

Upvotes: 0

Views: 1373

Answers (4)

vpathak
vpathak

Reputation: 1163

You should look at dynamicField in schema.xml. See example at http://wiki.apache.org/solr/SchemaXml

Upvotes: 0

Marko Bonaci
Marko Bonaci

Reputation: 5708

Yes, either define schema or use ElasticSearch :)

Upvotes: 2

RoiG
RoiG

Reputation: 478

Your index is defined by a schema.xml file. There all the fields you like to index appear. However, you are trying to add a Solr document with a field named job_id. This field is NOT IN YOUR SCHEMA. Add this field or remove it from the document.

Upvotes: 4

Fuxi
Fuxi

Reputation: 5488

Look around "job_id" this is not existing where you are thinking it is/should be.

ERROR: [doc=null] unknown field 'job_id' at

Upvotes: 2

Related Questions