lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From William Bell <billnb...@gmail.com>
Subject Re: 3 Way Solr Join . . ?
Date Sun, 11 Mar 2012 07:36:30 GMT
Yeah I am a bit afraid when people want to use the join() feature. To
get good performance you really need to try to stick to the
recommendation of denormalizing your database into multiValued search
fields.

You can also use external fields, or store formatted info into a
String field in json or xml format.


On Sat, Mar 10, 2012 at 6:22 PM, Walter Underwood <wunder@wunderwood.org> wrote:
> Fields can be multi-valued. Put multiple phone numbers in a field and match all of them.
>
> wunder
>
> On Mar 10, 2012, at 4:58 PM, Angelina Bola wrote:
>
>> Does "Solr" support a 3-way join? i.e.
>> http://wiki.apache.org/solr/Join (I have the 2-way join working)
>>
>> For example, I am pulling 3 different tables from a RDBMS into one Solr core:
>>
>>   Table#1: Customers     (parent table)
>>   Table#2: Addresses  (child table with foreign key to customers)
>>   Table#3: Phones     (child table with foreign key to customers)
>>
>> with a ONE to MANY relationship between:
>>
>>       Customers and Addresses
>>       Customers and Phones
>>
>> When I pull them into Solr I cannot denormalize the relationships as a
>> given customers can have many addresses and many phones.
>>
>> When they come into the my single core (customerInfo), each document
>> gets a customerInfo_type and a uid corresponding to that type, for
>> example:
>>
>>       Customer Document
>>               customerInfo_type='customer'
>>               customer_id
>>
>>       Address Document
>>               customerInfo_type='address'
>>               fk_address_customer_id
>>
>>       Phone Document
>>               customerInfo_type='phone'
>>               fk_phone_customer_id
>>
>> Logically, I need to query in Solr for Customers who:
>>
>>       - Have an address in a given state
>>       - Have a phone in a given area code
>>       - Are a given gender
>>
>> Syntactically, it would think it would look like:
>>
>> - http://localhost:8983/solr/customerInfo/select/?
>>     q={!join from=fk_address_customer_id to=customer_id}address_State:Maine&
>>     fq={!join from=customer_id to=fk_phone_customer_id}phone_area_code:212&
>>     fq=customer_gender:female
>>
>> But that does not work for me.
>>
>> Appreciate any thoughts,
>>
>> Angelyna
>
> --
> Walter Underwood
> wunder@wunderwood.org
>
>
>



-- 
Bill Bell
billnbell@gmail.com
cell 720-256-8076

Mime
View raw message