lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dyer, James" <>
Subject RE: Handling a closed IndexWriter in Solr
Date Wed, 13 Mar 2013 16:42:57 GMT

I have no idea how these problems might be related.  However, I think you can solve the problem
with DIH not being able to find the primary key if you explicitly declare it by specifying
the "pk" property on the parent entity.

<entity name="parent" pk="keyName" ... />

You might get more and better resonses to your solr-related question by posting to the solr-user
list rather than the java-user list.

James Dyer
Ingram Content Group
(615) 213-4311

-----Original Message-----
From: Danzig, Scott [] 
Sent: Wednesday, March 13, 2013 11:03 AM
Subject: Handling a closed IndexWriter in Solr
Importance: Low

Hey all,

We're using a Solr 4 core to handle our article data.  When someone in our CMS publishes an
article, we have a listener that indexes it straight to solr.  We use the previously instantiated
HttpSolrServer, build the solr document, add it with server.add(doc) .. then do a server.commit()
right away.  This works fine, except that meanwhile, another process is importing new data
from an SQL db into the same core.  For some reason, sometimes this process errors:

Feb 26, 2013 3:05:03 PM org.apache.solr.handler.dataimport.DataImporter doDeltaImport
SEVERE: Delta Import Failed
java.lang.RuntimeException: java.lang.IllegalArgumentException: deltaQuery has no column to
resolve to declared primary key pk='id'
       at org.apache.solr.handler.dataimport.DocBuilder.execute(
       at org.apache.solr.handler.dataimport.DataImporter.doDeltaImport(
       at org.apache.solr.handler.dataimport.DataImporter.runCmd(
       at org.apache.solr.handler.dataimport.DataImporter$
Caused by: java.lang.IllegalArgumentException: deltaQuery has no column to resolve to declared
primary key pk='id'
       at org.apache.solr.handler.dataimport.DocBuilder.findMatchingPkColumn(
       at org.apache.solr.handler.dataimport.DocBuilder.collectDelta(
       at org.apache.solr.handler.dataimport.DocBuilder.doDelta(
       at org.apache.solr.handler.dataimport.DocBuilder.execute(
       ... 3 more

Not really relevant to this problem, because I basically want my real time indexing to keep
working in spite of this.  However, when it's happening, I am pretty sure this is causing
my real-time indexing commit to throw this exception:

Feb 26, 2013 5:07:51 PM org.apache.solr.common.SolrException log
SEVERE: null:org.apache.solr.common.SolrException: Error opening new searcher
at org.apache.solr.core.SolrCore.openNewSearcher(
at org.apache.solr.core.SolrCore.getSearcher(
at org.apache.solr.core.SolrCore.getSearcher(
at org.apache.solr.update.DirectUpdateHandler2.commit(
at org.apache.solr.update.processor.RunUpdateProcessor.processCommit(
at org.apache.solr.update.processor.UpdateRequestProcessor.processCommit(
at org.apache.solr.update.processor.DistributedUpdateProcessor.processCommit(
at org.apache.solr.update.processor.LogUpdateProcessor.processCommit(
at org.apache.solr.handler.RequestHandlerUtils.handleCommit(
at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(
at org.apache.solr.handler.RequestHandlerBase.handleRequest(
at org.apache.solr.core.SolrCore.execute(
at org.apache.solr.servlet.SolrDispatchFilter.execute(
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.valves.AccessLogValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.AbstractHttp11Processor.process(
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
at java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.util.concurrent.ThreadPoolExecutor$
Caused by: this IndexWriter is closed
at org.apache.lucene.index.IndexWriter.ensureOpen(
at org.apache.lucene.index.IndexWriter.ensureOpen(
at org.apache.lucene.index.IndexWriter.nrtIsCurrent(
at org.apache.lucene.index.StandardDirectoryReader.doOpenFromWriter(
at org.apache.lucene.index.StandardDirectoryReader.doOpenIfChanged(
at org.apache.lucene.index.StandardDirectoryReader.doOpenIfChanged(
at org.apache.lucene.index.DirectoryReader.openIfChanged(
at org.apache.solr.core.SolrCore.openNewSearcher(
... 28 more

Usually, I can get around this by basically creating a new HttpSolrServer and trying again.
 But if the problem is very frequent, one more try doesn't work.  I don't like the idea of
continually trying new solr connections until it works.  What's the proper way to fix this?
 I'm assuming adding a doc with a commitWithMs of "0" is not any different than committing
right away, but that suggestion was raised as well.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message