Thanks Erik. 
If I convert that to a string then id field defined in schema.xml would
fail as I have that as integer. If I change that to string then first
view would fail as it is Integer there. What to do in such scenarios? Do
I need to define multiple schema.xml or multiple unique key definitions
in same schema. How does this work? Pls explain. 

-----Original Message-----
From: Erik Hatcher [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 20, 2008 6:40 PM
To: solr-user@lucene.apache.org
Subject: Re: Unique id

I'd suggest aggregating those three columns into a string that can  
serve as the Solr uniqueKey field value.

        Erik


On Nov 20, 2008, at 1:10 AM, Raghunandan Rao wrote:

> Basically, I am working on two views. First one has an ID column. The
> second view has no unique ID column. What to do in such situations?
> There are 3 other columns where I can make a composite key out of  
> those.
> I have to index these two views now.
>
>
> -----Original Message-----
> From: Erik Hatcher [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, November 19, 2008 5:24 PM
> To: solr-user@lucene.apache.org
> Subject: Re: Unique id
>
> Technically, no, a uniqueKey field is NOT required.  I've yet to run
> into a situation where it made sense not to use one though.
>
> As for indexing database tables - if one of your tables doesn't have a
> primary key, does it have an aggregate unique "key" of some sort?  Do
> you plan on updating the rows in that table and reindexing them?
> Seems like some kind of unique key would make sense for updating
> documents.
>
> But yeah, a more detailed description of your table structure and
> searching needs would be helpful.
>
>       Erik
>
>
> On Nov 19, 2008, at 5:18 AM, Aleksander M. Stensby wrote:
>
>> Yes it is. You need a unique id because the add method works as and
>> "add or update" method. When adding a document whose ID is already
>> found in the index, the old document will be deleted and the new
>> will be added. Are you indexing two tables into the same index? Or
>> does one entry in the index consist of data from both tables? How
>> are these linked together without an ID?
>>
>> - Aleksander
>>
>> On Wed, 19 Nov 2008 10:42:00 +0100, Raghunandan Rao
> <[EMAIL PROTECTED]
>>> wrote:
>>
>>> Hi,
>>>
>>> Is the uniqueKey in schema.xml really required?
>>>
>>>
>>> Reason is, I am indexing two tables and I have id as unique key in
>>> schema.xml but id field is not there in one of the tables and
>>> indexing
>>> fails. Do I really require this unique field for Solr to index it
>>> better
>>> or can I do away with this?
>>>
>>>
>>> Thanks,
>>>
>>> Rahgu
>>>
>>
>>
>>
>> -- 
>> Aleksander M. Stensby
>> Senior software developer
>> Integrasco A/S
>> www.integrasco.no

Reply via email to