lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack Krupansky" <j...@basetechnology.com>
Subject Re: Multitable import - uniqueKey
Date Mon, 03 Jun 2013 15:16:00 GMT
Yes, every Solr document needs a unique key - if you want to be able to 
address documents by a unique key. Solr itself does not require a unique key 
for all use cases, but there are plenty of operations where a unique key is 
needed.

Now, how much data you join into a single document is up to you, the data 
architect. Why are you asking us? Tell us what your Solr data model is.

Who knows, maybe each super document should be broken into separate Solr 
collections, or separate mini-documents with documents types (e.g., the 
original table name). That's a decision for the data architect. Solr doesn't 
really care.

The real bottom line is that you need to be clear about your data model 
requirements. For example, how will your users be querying the data and what 
results will they expect.

-- Jack Krupansky

-----Original Message----- 
From: Raheel Hasan
Sent: Monday, June 03, 2013 11:06 AM
To: solr-user@lucene.apache.org
Subject: Re: Multitable import - uniqueKey

ok. But do we need it? Thats what I am confused at. should 1 key from
table_1 pull all the data in relationship as they were inserted?


On Mon, Jun 3, 2013 at 7:53 PM, Jack Krupansky 
<jack@basetechnology.com>wrote:

> Same answer. Whether it is 2, 3, 10 or 1000 tables, you, the data
> architect must decide how to uniquely identify Solr documents. In general,
> when joining n tables, combine the n keys into one composite key. Either 
> do
> it on the SQL query side, or with a Solr update request processor.
>
>
> -- Jack Krupansky
>
> -----Original Message----- From: Raheel Hasan
> Sent: Monday, June 03, 2013 10:44 AM
> To: solr-user@lucene.apache.org
> Subject: Re: Multitable import - uniqueKey
>
>
> Hi,
>
> Thanks for the replies. Actually, I had only a small confusion:
>
> From table_1 I got key_1; using this I join into table_2. But table_2 also
> gave another key key_2 which is needed for joining with table_3.
>
> So for Table1 and Table2 its obviously just fine... but what will happen
> when table3 is also added? will the 3 tables be intact in terms of
> relationship?
>
> Thanks.
>
>
>
> On Mon, Jun 3, 2013 at 7:33 PM, Jack Krupansky <jack@basetechnology.com>**
> wrote:
>
>  If the respective table IDs are not globally unique, then you (the
>> developer) will have to supplement the raw ID with a prefix or suffix or
>> other form of global ID (e.g., UUID) to assure that they are unique. You
>> could just add the SQL table name as a prefix or suffix.
>>
>> The bottom line: What do you WANT the Solr key field to look like? I 
>> mean,
>> YOU are the data architect, right? What requirements do you have? When
>> your
>> Solr application users receive the key values in the responses to 
>> queries,
>> what expectations do you expect to set for them?
>>
>> -- Jack Krupansky
>>
>> -----Original Message----- From: Raheel Hasan
>> Sent: Monday, June 03, 2013 9:12 AM
>> To: solr-user@lucene.apache.org
>> Subject: Multitable import - uniqueKey
>>
>>
>> Hi,
>>
>> I am importing multiple table (by join) into solr using DIH. All is set,
>> except for 1 confusion:
>> what to do with "*<uniqueKey>*" in schema?
>>
>>
>> When I had only 1 table, I had it fine. Now how to put 2 uniqueKeys (both
>> from different table).
>>
>> For example:
>>
>> <uniqueKey>table1_id</****uniqueKey>
>> <uniqueKey>table2_id</****uniqueKey>
>>
>>
>> Will this work?
>>
>> --
>> Regards,
>> Raheel Hasan
>>
>>
>
>
> --
> Regards,
> Raheel Hasan
>



-- 
Regards,
Raheel Hasan 


Mime
View raw message