lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexandre Rafalovitch <arafa...@gmail.com>
Subject Re: Use a constant entity in all imported documents of DIH
Date Fri, 12 Dec 2014 21:40:02 GMT
Have a look at the documentation for the rootEntity attribute.
https://wiki.apache.org/solr/DataImportHandler

If you set it on the outer entity, I think it should give you what you
want with the nested entity structure. Then the outside entity will
load from the constant table and the inside from body_shops.

Regards,
   Alex.
Personal: http://www.outerthoughts.com/ and @arafalov
Solr resources and newsletter: http://www.solr-start.com/ and @solrstart
Solr popularizers community: https://www.linkedin.com/groups?gid=6713853


On 12 December 2014 at 14:52, Per Newgro <per.newgro@gmx.ch> wrote:
> Do you mean with inner entity something like
>     <document>
>         <entity name="bodyshop" query="select id , customer_number
> body_shops where state = 1>
>             <field name="id" column="ID" />
>             <field name="customer_number" column="CUSTOMER_NUMBER" />
>             <entity name="facility" query="select name from facilities where
> body_shop_id=${bodyshop.ID}">
>                 <field name="name" column="name" />
>             </entity>
>        </entity>
>     </document>
>
> Yes that i could use. But i would use always the same entity in the where
> clause of the sub-entity.
> I would like to do something like
>
>     <!-- load a constant entity>
>     <entity name = "constant" query="select attr from constants where state
> = 1">
>     </entity>
>     <document>
>         <entity name="bodyshop" query="select id , customer_number from
> body_shops where state = 1>
>             <field name="id" column="ID" />
>             <field name="customer_number" column="CUSTOMER_NUMBER" />
>             <!-- use data of constant entity here -->
>             <entity name="facility" query="select name from facilities where
> body_shop_id=${bodyshop.ID} and constant_attr = ${constant.attr}">
>                 <field name="name" column="name" />
>             </entity>
>        </entity>
>     </document>
>
> I would like to avoid that repeating join that is required with the above
> "inner entity" method above.
>
> Thanks for your support
> Per
>
>
> Am 12.12.2014 um 18:22 schrieb Alexandre Rafalovitch:
>
>> Sounds like a case for nested entity definitions with the inner entity
>> being the one that's actually indexed? Just need to remember that all
>> the parent mapping is also applicable to all children.
>>
>> Have you tried that?
>>
>> Regards,
>>     Alex.
>>
>>
>> Personal: http://www.outerthoughts.com/ and @arafalov
>> Solr resources and newsletter: http://www.solr-start.com/ and @solrstart
>> Solr popularizers community: https://www.linkedin.com/groups?gid=6713853
>>
>>
>> On 12 December 2014 at 12:15, Per Newgro <per.newgro@gmx.ch> wrote:
>>>
>>> Hello,
>>>
>>> i would like to load an entity before document import in DIH starts.
>>> I want to use the entity id for a sub-select in the document entity.
>>>
>>> Can i achieve something like that?
>>>
>>> Thanks for helping me
>>> Per
>
>

Mime
View raw message