You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Mark <st...@gmail.com> on 2011/12/05 20:04:02 UTC
Question on DIH delta imports
*pk*: The primary key for the entity. It is*optional*and only needed
when using delta-imports. It has no relation to the uniqueKey defined in
schema.xml but they both can be the same.
When using in a nested entity is the PK the primary key column of the
join table or the key used for joining? For example
Say I have table /foo/ whose primary id is id and table /sub_foo/ whose
primary key is also id. Table sub_foo also has a column named/foo_id/
that is used for joining /foo/ and /sub_foo/.
Should it be:
<entity name="foo" pk="id" query="select * from foo"...>
<entity name="sub_foo" pk="foo_id" deltaQuery="select foo_id from sub_foo where..."/>
</entity>
Or:
<entity name="foo" pk="id" query="select * from foo"...>
<entity name="sub_foo" pk="id" deltaQuery="select foo_id from sub_foo where..."/>
</entity>
Thanks for your help
Re: Question on DIH delta imports
Posted by Chris Hostetter <ho...@fucit.org>.
: *pk*: The primary key for the entity. It is*optional*and only needed when
: using delta-imports. It has no relation to the uniqueKey defined in schema.xml
: but they both can be the same.
:
: When using in a nested entity is the PK the primary key column of the join
: table or the key used for joining? For example
As i understand it, the "pk" is the field(s) in that entity that can be
used to join that entity with other entities (either up or down)
Note in particular the example on the wiki, and how the "item_category"
entity has pk="ITEM_ID, CATEGORY_ID" ... "ITEM_ID" is used to join "up" to
the "item" entity, and "CATEGORY_ID" is used to join "down" to the
"category" entity...
https://wiki.apache.org/solr/DataImportHandler#Delta-Import_Example
(If that example isn't super clear, it may help to look at the table
definitions in solr/example/example-DIH/hsqldb/ex.script)
-Hoss
Re: Question on DIH delta imports
Posted by Mark <st...@gmail.com>.
Anyone?
On 12/5/11 11:04 AM, Mark wrote:
> *pk*: The primary key for the entity. It is*optional*and only needed
> when using delta-imports. It has no relation to the uniqueKey defined
> in schema.xml but they both can be the same.
>
> When using in a nested entity is the PK the primary key column of the
> join table or the key used for joining? For example
>
> Say I have table /foo/ whose primary id is id and table /sub_foo/
> whose primary key is also id. Table sub_foo also has a column
> named/foo_id/ that is used for joining /foo/ and /sub_foo/.
>
> Should it be:
> <entity name="foo" pk="id" query="select * from foo"...>
> <entity name="sub_foo" pk="foo_id" deltaQuery="select foo_id from sub_foo where..."/>
> </entity>
> Or:
> <entity name="foo" pk="id" query="select * from foo"...>
> <entity name="sub_foo" pk="id" deltaQuery="select foo_id from sub_foo where..."/>
> </entity>
>
> Thanks for your help
>
>