lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Hatcher (JIRA)" <>
Subject [jira] Commented: (SOLR-1229) deletedPkQuery feature does not work when pk and uniqueKey field do not have the same value
Date Tue, 30 Jun 2009 13:58:47 GMT


Erik Hatcher commented on SOLR-1229:

Lance - I too get failures with your tests.  Here's one example:

junit.framework.AssertionFailedError: query failed XPath: //*[@numFound='0'] xml response
was: <?xml version="1.0" encoding="UTF-8"?>
<lst name="responseHeader"><int name="status">0</int><int name="QTime">1</int><lst
name="params"><str name="rows">20</str><str name="start">0</str><str
name="q">desc:hello OR XtestCompositePk_DeltaImport_replace_nodelete</str><str
name="qt">standard</str><str name="version">2.2</str></lst></lst><result
name="response" numFound="1" start="0"><doc><arr name="desc"><str>hello</str></arr><str
name="id">1</str><date name="timestamp">2009-06-30T13:55:58.2Z</date></doc></result>

	at org.apache.solr.util.AbstractSolrTestCase.assertQ(
	at org.apache.solr.util.AbstractSolrTestCase.assertQ(
	at org.apache.solr.handler.dataimport.TestSqlEntityProcessorDelta.testCompositePk_DeltaImport_replace_nodelete(

> deletedPkQuery feature does not work when pk and uniqueKey field do not have the same
> -------------------------------------------------------------------------------------------
>                 Key: SOLR-1229
>                 URL:
>             Project: Solr
>          Issue Type: Bug
>          Components: contrib - DataImportHandler
>    Affects Versions: 1.4
>            Reporter: Erik Hatcher
>            Assignee: Noble Paul
>             Fix For: 1.4
>         Attachments: SOLR-1229.patch, SOLR-1229.patch, SOLR-1229.patch, tests.patch
> Problem doing a delta-import such that records marked as "deleted" in the database are
removed from Solr using deletedPkQuery.
> Here's a config I'm using against a mocked test database:
> {code:xml}
> <dataConfig>
>  <dataSource driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/db"/>
>  <document name="tests">
>    <entity name="test"
>            pk="board_id"
>            transformer="TemplateTransformer"
>            deletedPkQuery="select board_id from boards where deleted = 'Y'"
>            query="select * from boards where deleted = 'N'"
>            deltaImportQuery="select * from boards where deleted = 'N'"
>            deltaQuery="select * from boards where deleted = 'N'"
>            preImportDeleteQuery="datasource:board">
>      <field column="id" template="board-${test.board_id}"/>
>      <field column="datasource" template="board"/>
>      <field column="title" />
>    </entity>
>  </document>
> </dataConfig>
> {code}
> Note that the uniqueKey in Solr is the "id" field.  And its value is a template board-<PK>.
> I noticed the javadoc comments in DocBuilder#collectDelta it says "Note: In our definition,
unique key of Solr document is the primary key of the top level entity".  This of course isn't
really an appropriate assumption.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message